{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import fitz\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sys import path"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['/home/huang/sympy_work_code',\n",
       " '/home/huang/anaconda3/lib/python39.zip',\n",
       " '/home/huang/anaconda3/lib/python3.9',\n",
       " '/home/huang/anaconda3/lib/python3.9/lib-dynload',\n",
       " '',\n",
       " '/home/huang/.local/lib/python3.9/site-packages',\n",
       " '/home/huang/anaconda3/lib/python3.9/site-packages',\n",
       " '/home/huang/anaconda3/lib/python3.9/site-packages/IPython/extensions',\n",
       " '/home/huang/.ipython']"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "path"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'/home/huang/sympy_work_code'"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "os.path.abspath(\"./\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "work_path=os.path.abspath(\"../Documents/machine-readproofing/\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'/home/huang/Documents/machine-readproofing'"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "work_path"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "doc=fitz.open(work_path+\"/工银亚洲营业部.pdf\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "file_str=work_path+\"/output.txt\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'/home/huang/Documents/machine-readproofing/output.txt'"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "file_str"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "out = open(file_str, \"wb\") # create a text output\n",
    "for page in doc: # iterate the document pages\n",
    "    text = page.get_text().encode(\"utf8\") # get plain text (is in UTF-8)\n",
    "    out.write(text) # write text of page\n",
    "    out.write(bytes((12,))) # write page delimiter (form feed 0x0C)\n",
    "out.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "# out=open(file=file_str,\"wb\")\n",
    "areas=doc[0].search_for(\"分行\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "list"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(areas)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "22"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(areas)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on package fitz:\n",
      "\n",
      "NAME\n",
      "    fitz\n",
      "\n",
      "DESCRIPTION\n",
      "    PyMuPDF 1.24.1: Python bindings for the MuPDF 1.24.1 library (rebased implementation).\n",
      "    Python 3.9 running on linux (64-bit).\n",
      "\n",
      "PACKAGE CONTENTS\n",
      "    __main__\n",
      "    _extra\n",
      "    _mupdf\n",
      "    extra\n",
      "    fitz\n",
      "    mupdf\n",
      "    table\n",
      "    utils\n",
      "\n",
      "CLASSES\n",
      "    builtins.DeprecationWarning(builtins.Warning)\n",
      "        FitzDeprecation\n",
      "    builtins.RuntimeError(builtins.Exception)\n",
      "        FileDataError\n",
      "            EmptyFileError\n",
      "        FileNotFoundError\n",
      "    builtins.object\n",
      "        Annot\n",
      "        Archive\n",
      "        Colorspace\n",
      "        DeviceWrapper\n",
      "        DisplayList\n",
      "        Document\n",
      "        DocumentWriter\n",
      "        ElementPosition\n",
      "        Font\n",
      "        Graftmap\n",
      "        IRect\n",
      "        Link\n",
      "        Matrix\n",
      "            IdentityMatrix\n",
      "        Outline\n",
      "        Page\n",
      "        Pixmap\n",
      "        Point\n",
      "        Quad\n",
      "        Rect\n",
      "        Shape\n",
      "        Story\n",
      "        TOOLS\n",
      "        TextPage\n",
      "        TextWriter\n",
      "        Widget\n",
      "        Xml\n",
      "        linkDest\n",
      "    fitz.mupdf.FzDevice2(fitz.mupdf.FzDevice)\n",
      "        JM_new_bbox_device_Device\n",
      "        JM_new_lineart_device_Device\n",
      "        JM_new_texttrace_device\n",
      "    fitz.mupdf.FzOutput2(fitz.mupdf.FzOutput)\n",
      "        JM_new_output_fileptr_Output\n",
      "    fitz.mupdf.FzPathWalker2(fitz.mupdf.FzPathWalker)\n",
      "        Walker\n",
      "    fitz.mupdf.PdfFilterOptions2(fitz.mupdf.PdfFilterOptions)\n",
      "        JM_image_reporter_Filter\n",
      "    \n",
      "    class Annot(builtins.object)\n",
      "     |  Annot(annot)\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, annot)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  __repr__(self)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __str__(self)\n",
      "     |      Return str(self).\n",
      "     |  \n",
      "     |  clean_contents(self, sanitize=1)\n",
      "     |      Clean appearance contents stream.\n",
      "     |  \n",
      "     |  delete_responses(self)\n",
      "     |      Delete 'Popup' and responding annotations.\n",
      "     |  \n",
      "     |  get_file(self)\n",
      "     |      Retrieve attached file content.\n",
      "     |  \n",
      "     |  get_oc(self)\n",
      "     |      Get annotation optional content reference.\n",
      "     |  \n",
      "     |  get_parent(self)\n",
      "     |      # PyMuPDF doesn't seem to have this .parent member, but removing it breaks\n",
      "     |      # 11 tests...?\n",
      "     |      #@property\n",
      "     |  \n",
      "     |  get_pixmap(self, matrix=None, dpi=None, colorspace=None, alpha=0)\n",
      "     |      annotation Pixmap\n",
      "     |  \n",
      "     |  get_sound(self)\n",
      "     |      Retrieve sound stream.\n",
      "     |  \n",
      "     |  get_text(page: fitz.Page, option: str = 'text', clip: 'rect_like' = None, flags: Optional[int] = None, textpage: fitz.TextPage = None, sort: bool = False, delimiters=None)\n",
      "     |      Extract text from a page or an annotation.\n",
      "     |      \n",
      "     |      This is a unifying wrapper for various methods of the fitz.TextPage class.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          option: (str) text, words, blocks, html, dict, json, rawdict, xhtml or xml.\n",
      "     |          clip: (rect-like) restrict output to this area.\n",
      "     |          flags: bit switches to e.g. exclude images or decompose ligatures.\n",
      "     |          textpage: reuse this fitz.TextPage and make no new one. If specified,\n",
      "     |              'flags' and 'clip' are ignored.\n",
      "     |      \n",
      "     |      Returns:\n",
      "     |          the output of methods get_text_words / get_text_blocks or fitz.TextPage\n",
      "     |          methods extractText, extractHTML, extractDICT, extractJSON, extractRAWDICT,\n",
      "     |          extractXHTML or etractXML respectively.\n",
      "     |          Default and misspelling choice is \"text\".\n",
      "     |  \n",
      "     |  get_textbox(page: fitz.Page, rect: 'rect_like', textpage: fitz.TextPage = None) -> str\n",
      "     |  \n",
      "     |  get_textpage(self, clip=None, flags=0)\n",
      "     |      Make annotation TextPage.\n",
      "     |  \n",
      "     |  set_apn_bbox(self, bbox)\n",
      "     |      Set annotation appearance bbox.\n",
      "     |  \n",
      "     |  set_apn_matrix(self, matrix)\n",
      "     |      Set annotation appearance matrix.\n",
      "     |  \n",
      "     |  set_blendmode(self, blend_mode)\n",
      "     |      Set annotation BlendMode.\n",
      "     |  \n",
      "     |  set_border(self, border=None, width=-1, style=None, dashes=None, clouds=-1)\n",
      "     |      Set border properties.\n",
      "     |      \n",
      "     |      Either a dict, or direct arguments width, style, dashes or clouds.\n",
      "     |  \n",
      "     |  set_colors(self, colors=None, stroke=None, fill=None)\n",
      "     |      Set 'stroke' and 'fill' colors.\n",
      "     |      \n",
      "     |      Use either a dict or the direct arguments.\n",
      "     |  \n",
      "     |  set_flags(self, flags)\n",
      "     |      Set annotation flags.\n",
      "     |  \n",
      "     |  set_info(self, info=None, content=None, title=None, creationDate=None, modDate=None, subject=None)\n",
      "     |      Set various properties.\n",
      "     |  \n",
      "     |  set_irt_xref(self, xref)\n",
      "     |      Set annotation IRT xref\n",
      "     |  \n",
      "     |  set_language(self, language=None)\n",
      "     |      Set annotation language.\n",
      "     |  \n",
      "     |  set_line_ends(self, start, end)\n",
      "     |      Set line end codes.\n",
      "     |  \n",
      "     |  set_name(self, name)\n",
      "     |      Set /Name (icon) of annotation.\n",
      "     |  \n",
      "     |  set_oc(self, oc=0)\n",
      "     |      Set / remove annotation OC xref.\n",
      "     |  \n",
      "     |  set_opacity(self, opacity)\n",
      "     |      Set opacity.\n",
      "     |  \n",
      "     |  set_open(self, is_open)\n",
      "     |      Set 'open' status of annotation or its Popup.\n",
      "     |  \n",
      "     |  set_popup(self, rect)\n",
      "     |      Create annotation 'Popup' or update rectangle.\n",
      "     |  \n",
      "     |  set_rect(self, rect)\n",
      "     |      Set annotation rectangle.\n",
      "     |  \n",
      "     |  set_rotation(self, rotate=0)\n",
      "     |      Set annotation rotation.\n",
      "     |  \n",
      "     |  update(self, blend_mode: Optional[str] = None, opacity: Optional[float] = None, fontsize: float = 0, fontname: Optional[str] = None, text_color: Optional[Sequence] = None, border_color: Optional[Sequence] = None, fill_color: Optional[Sequence] = None, cross_out: bool = True, rotate: int = -1)\n",
      "     |      Update annot appearance.\n",
      "     |      \n",
      "     |      Notes:\n",
      "     |          Depending on the annot type, some parameters make no sense,\n",
      "     |          while others are only available in this method to achieve the\n",
      "     |          desired result. This is especially true for 'FreeText' annots.\n",
      "     |      Args:\n",
      "     |          blend_mode: set the blend mode, all annotations.\n",
      "     |          opacity: set the opacity, all annotations.\n",
      "     |          fontsize: set fontsize, 'FreeText' only.\n",
      "     |          fontname: set the font, 'FreeText' only.\n",
      "     |          border_color: set border color, 'FreeText' only.\n",
      "     |          text_color: set text color, 'FreeText' only.\n",
      "     |          fill_color: set fill color, all annotations.\n",
      "     |          cross_out: draw diagonal lines, 'Redact' only.\n",
      "     |          rotate: set rotation, 'FreeText' and some others.\n",
      "     |  \n",
      "     |  update_file(self, buffer_=None, filename=None, ufilename=None, desc=None)\n",
      "     |      Update attached file.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods defined here:\n",
      "     |  \n",
      "     |  update_timing_test()\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties defined here:\n",
      "     |  \n",
      "     |  apn_bbox\n",
      "     |      annotation appearance bbox\n",
      "     |  \n",
      "     |  apn_matrix\n",
      "     |      annotation appearance matrix\n",
      "     |  \n",
      "     |  blendmode\n",
      "     |      annotation BlendMode\n",
      "     |  \n",
      "     |  border\n",
      "     |      Border information.\n",
      "     |  \n",
      "     |  colors\n",
      "     |      Color definitions.\n",
      "     |  \n",
      "     |  file_info\n",
      "     |      Attached file information.\n",
      "     |  \n",
      "     |  flags\n",
      "     |      Flags field.\n",
      "     |  \n",
      "     |  has_popup\n",
      "     |      Check if annotation has a Popup.\n",
      "     |  \n",
      "     |  info\n",
      "     |      Various information details.\n",
      "     |  \n",
      "     |  irt_xref\n",
      "     |      annotation IRT xref\n",
      "     |  \n",
      "     |  is_open\n",
      "     |      Get 'open' status of annotation or its Popup.\n",
      "     |  \n",
      "     |  language\n",
      "     |      annotation language\n",
      "     |  \n",
      "     |  line_ends\n",
      "     |      Line end codes.\n",
      "     |  \n",
      "     |  next\n",
      "     |      Next annotation.\n",
      "     |  \n",
      "     |  opacity\n",
      "     |      Opacity.\n",
      "     |  \n",
      "     |  popup_rect\n",
      "     |      annotation 'Popup' rectangle\n",
      "     |  \n",
      "     |  popup_xref\n",
      "     |      annotation 'Popup' xref\n",
      "     |  \n",
      "     |  rect\n",
      "     |      annotation rectangle\n",
      "     |  \n",
      "     |  rect_delta\n",
      "     |      annotation delta values to rectangle\n",
      "     |  \n",
      "     |  rotation\n",
      "     |      annotation rotation\n",
      "     |  \n",
      "     |  type\n",
      "     |      annotation type\n",
      "     |  \n",
      "     |  vertices\n",
      "     |      annotation vertex points\n",
      "     |  \n",
      "     |  xref\n",
      "     |      annotation xref number\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class Archive(builtins.object)\n",
      "     |  Archive(*args)\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, *args)\n",
      "     |      Archive(dirname [, path]) - from folder\n",
      "     |      Archive(file [, path]) - from file name or object\n",
      "     |      Archive(data, name) - from memory item\n",
      "     |      Archive() - empty archive\n",
      "     |      Archive(archive [, path]) - from archive\n",
      "     |  \n",
      "     |  __repr__(self)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  add(self, content, path=None)\n",
      "     |      Add a sub-archive.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          content:\n",
      "     |              The content to be added. May be one of:\n",
      "     |                  `str` - must be path of directory or file.\n",
      "     |                  `bytes`, `bytearray`, `io.BytesIO` - raw data.\n",
      "     |                  `zipfile.Zipfile`.\n",
      "     |                  `tarfile.TarFile`.\n",
      "     |                  `fitz.Archive`.\n",
      "     |                  A two-item tuple `(data, name)`.\n",
      "     |                  List or tuple (but not tuple with length 2) of the above.\n",
      "     |          path: (str) a \"virtual\" path name, under which the elements\n",
      "     |              of content can be retrieved. Use it to e.g. cope with\n",
      "     |              duplicate element names.\n",
      "     |  \n",
      "     |  has_entry(self, name)\n",
      "     |  \n",
      "     |  read_entry(self, name)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties defined here:\n",
      "     |  \n",
      "     |  entry_list\n",
      "     |      List of sub archives.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class Colorspace(builtins.object)\n",
      "     |  Colorspace(type_)\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, type_)\n",
      "     |      Supported are GRAY, RGB and CMYK.\n",
      "     |  \n",
      "     |  __repr__(self)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties defined here:\n",
      "     |  \n",
      "     |  n\n",
      "     |      Size of one pixel.\n",
      "     |  \n",
      "     |  name\n",
      "     |      Name of the Colorspace.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class DeviceWrapper(builtins.object)\n",
      "     |  DeviceWrapper(*args)\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, *args)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class DisplayList(builtins.object)\n",
      "     |  DisplayList(*args)\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __del__(self)\n",
      "     |  \n",
      "     |  __init__(self, *args)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  get_pixmap(self, matrix=None, colorspace=None, alpha=0, clip=None)\n",
      "     |  \n",
      "     |  get_textpage(self, flags=3)\n",
      "     |  \n",
      "     |  run(self, dw, m, area)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties defined here:\n",
      "     |  \n",
      "     |  rect\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class Document(builtins.object)\n",
      "     |  Document(filename=None, stream=None, filetype=None, rect=None, width=0, height=0, fontsize=11)\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __contains__(self, loc) -> bool\n",
      "     |  \n",
      "     |  __delitem__(self, i) -> None\n",
      "     |  \n",
      "     |  __enter__(self)\n",
      "     |  \n",
      "     |  __exit__(self, *args)\n",
      "     |  \n",
      "     |  __getitem__(self, i: int = 0)\n",
      "     |  \n",
      "     |  __init__(self, filename=None, stream=None, filetype=None, rect=None, width=0, height=0, fontsize=11)\n",
      "     |      Creates a document. Use 'open' as a synonym.\n",
      "     |      \n",
      "     |      Notes:\n",
      "     |          Basic usages:\n",
      "     |          open() - new PDF document\n",
      "     |          open(filename) - string or pathlib.Path, must have supported\n",
      "     |                  file extension.\n",
      "     |          open(type, buffer) - type: valid extension, buffer: bytes object.\n",
      "     |          open(stream=buffer, filetype=type) - keyword version of previous.\n",
      "     |          open(filename, fileype=type) - filename with unrecognized extension.\n",
      "     |          rect, width, height, fontsize: layout reflowable document\n",
      "     |          on open (e.g. EPUB). Ignored if n/a.\n",
      "     |  \n",
      "     |  __len__(self) -> int\n",
      "     |  \n",
      "     |  __repr__(self) -> str\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  add_layer(self, name, creator=None, on=None)\n",
      "     |      Add a new OC layer.\n",
      "     |  \n",
      "     |  add_ocg(self, name, config=-1, on=1, intent=None, usage=None)\n",
      "     |      Add new optional content group.\n",
      "     |  \n",
      "     |  authenticate(self, password)\n",
      "     |      Decrypt document.\n",
      "     |  \n",
      "     |  can_save_incrementally(self)\n",
      "     |      Check whether incremental saves are possible.\n",
      "     |  \n",
      "     |  chapter_page_count(self, chapter)\n",
      "     |      Page count of chapter.\n",
      "     |  \n",
      "     |  close(self)\n",
      "     |      Close document.\n",
      "     |  \n",
      "     |  convert_to_pdf(self, from_page=0, to_page=-1, rotate=0)\n",
      "     |      Convert document to a PDF, selecting page range and optional rotation. Output bytes object.\n",
      "     |  \n",
      "     |  copy_page(self, pno: int, to: int = -1)\n",
      "     |      Copy a page within a PDF document.\n",
      "     |      \n",
      "     |      This will only create another reference of the same page object.\n",
      "     |      Args:\n",
      "     |          pno: source page number\n",
      "     |          to: put before this page, '-1' means after last page.\n",
      "     |  \n",
      "     |  del_toc_item(doc: fitz.Document, idx: int) -> None\n",
      "     |      Delete TOC / bookmark item by index.\n",
      "     |  \n",
      "     |  del_xml_metadata(self)\n",
      "     |      Delete XML metadata.\n",
      "     |  \n",
      "     |  delete_page(self, pno: int = -1)\n",
      "     |      Delete one page from a PDF.\n",
      "     |  \n",
      "     |  delete_pages(self, *args, **kw)\n",
      "     |      Delete pages from a PDF.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          Either keywords 'from_page'/'to_page', or two integers to\n",
      "     |          specify the first/last page to delete.\n",
      "     |          Or a list/tuple/range object, which can contain arbitrary\n",
      "     |          page numbers.\n",
      "     |  \n",
      "     |  embfile_add(self, name: str, buffer_: ByteString, filename: Optional[str] = None, ufilename: Optional[str] = None, desc: Optional[str] = None) -> None\n",
      "     |      Add an item to the EmbeddedFiles array.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          name: name of the new item, must not already exist.\n",
      "     |          buffer_: (binary data) the file content.\n",
      "     |          filename: (str) the file name, default: the name\n",
      "     |          ufilename: (unicode) the file name, default: filename\n",
      "     |          desc: (str) the description.\n",
      "     |  \n",
      "     |  embfile_count(self) -> int\n",
      "     |      Get number of EmbeddedFiles.\n",
      "     |  \n",
      "     |  embfile_del(self, item: Union[int, str])\n",
      "     |      Delete an entry from EmbeddedFiles.\n",
      "     |      \n",
      "     |      Notes:\n",
      "     |          The argument must be name or index of an EmbeddedFiles item.\n",
      "     |          Physical deletion of data will happen on save to a new\n",
      "     |          file with appropriate garbage option.\n",
      "     |      Args:\n",
      "     |          item: name or number of item.\n",
      "     |      Returns:\n",
      "     |          None\n",
      "     |  \n",
      "     |  embfile_get(self, item: Union[int, str]) -> bytes\n",
      "     |      Get the content of an item in the EmbeddedFiles array.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          item: number or name of item.\n",
      "     |      Returns:\n",
      "     |          (bytes) The file content.\n",
      "     |  \n",
      "     |  embfile_info(self, item: Union[int, str]) -> dict\n",
      "     |      Get information of an item in the EmbeddedFiles array.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          item: number or name of item.\n",
      "     |      Returns:\n",
      "     |          Information dictionary.\n",
      "     |  \n",
      "     |  embfile_names(self) -> list\n",
      "     |      Get list of names of EmbeddedFiles.\n",
      "     |  \n",
      "     |  embfile_upd(self, item: Union[int, str], buffer_: Optional[ByteString] = None, filename: Optional[str] = None, ufilename: Optional[str] = None, desc: Optional[str] = None) -> None\n",
      "     |      Change an item of the EmbeddedFiles array.\n",
      "     |      \n",
      "     |      Notes:\n",
      "     |          Only provided parameters are changed. If all are omitted,\n",
      "     |          the method is a no-op.\n",
      "     |      Args:\n",
      "     |          item: number or name of item.\n",
      "     |          buffer_: (binary data) the new file content.\n",
      "     |          filename: (str) the new file name.\n",
      "     |          ufilename: (unicode) the new filen ame.\n",
      "     |          desc: (str) the new description.\n",
      "     |  \n",
      "     |  extract_font(self, xref=0, info_only=0, named=None)\n",
      "     |      Get a font by xref. Returns a tuple or dictionary.\n",
      "     |  \n",
      "     |  extract_image(self, xref)\n",
      "     |      Get image by xref. Returns a dictionary.\n",
      "     |  \n",
      "     |  ez_save(self, filename, garbage=3, clean=False, deflate=True, deflate_images=True, deflate_fonts=True, incremental=False, ascii=False, expand=False, linear=False, pretty=False, encryption=1, permissions=4095, owner_pw=None, user_pw=None, no_new_id=True, preserve_metadata=1, use_objstms=1, compression_effort=0)\n",
      "     |      Save PDF using some different defaults\n",
      "     |  \n",
      "     |  find_bookmark(self, bm)\n",
      "     |      Find new location after layouting a document.\n",
      "     |  \n",
      "     |  fullcopy_page(self, pno, to=-1)\n",
      "     |      Make a full page duplicate.\n",
      "     |  \n",
      "     |  get_char_widths(doc: fitz.Document, xref: int, limit: int = 256, idx: int = 0, fontdict: Optional[dict] = None) -> list\n",
      "     |      Get list of glyph information of a font.\n",
      "     |      \n",
      "     |      Notes:\n",
      "     |          Must be provided by its XREF number. If we already dealt with the\n",
      "     |          font, it will be recorded in doc.FontInfos. Otherwise we insert an\n",
      "     |          entry there.\n",
      "     |          Finally we return the glyphs for the font. This is a list of\n",
      "     |          (glyph, width) where glyph is an integer controlling the char\n",
      "     |          appearance, and width is a float controlling the char's spacing:\n",
      "     |          width * fontsize is the actual space.\n",
      "     |          For 'simple' fonts, glyph == ord(char) will usually be true.\n",
      "     |          Exceptions are 'Symbol' and 'ZapfDingbats'. We are providing data for these directly here.\n",
      "     |  \n",
      "     |  get_layer(self, config=-1)\n",
      "     |      Content of ON, OFF, RBGroups of an OC layer.\n",
      "     |  \n",
      "     |  get_layers(self)\n",
      "     |      Show optional OC layers.\n",
      "     |  \n",
      "     |  get_new_xref(self)\n",
      "     |      Make new xref.\n",
      "     |  \n",
      "     |  get_oc(doc: fitz.Document, xref: int) -> int\n",
      "     |      Return optional content object xref for an image or form xobject.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          xref: (int) xref number of an image or form xobject.\n",
      "     |  \n",
      "     |  get_ocgs(self)\n",
      "     |      Show existing optional content groups.\n",
      "     |  \n",
      "     |  get_ocmd(doc: fitz.Document, xref: int) -> dict\n",
      "     |      Return the definition of an OCMD (optional content membership dictionary).\n",
      "     |      \n",
      "     |      Recognizes PDF dict keys /OCGs (PDF array of OCGs), /P (policy string) and\n",
      "     |      /VE (visibility expression, PDF array). Via string manipulation, this\n",
      "     |      info is converted to a Python dictionary with keys \"xref\", \"ocgs\", \"policy\"\n",
      "     |      and \"ve\" - ready to recycle as input for 'set_ocmd()'.\n",
      "     |  \n",
      "     |  get_outline_xrefs(self)\n",
      "     |      Get list of outline xref numbers.\n",
      "     |  \n",
      "     |  get_page_fonts(self, pno: int, full: bool = False) -> list\n",
      "     |      Retrieve a list of fonts used on a page.\n",
      "     |  \n",
      "     |  get_page_images(self, pno: int, full: bool = False) -> list\n",
      "     |      Retrieve a list of images used on a page.\n",
      "     |  \n",
      "     |  get_page_labels(doc)\n",
      "     |      Return page label definitions in PDF document.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          doc: PDF document (resp. 'self').\n",
      "     |      Returns:\n",
      "     |          A list of dictionaries with the following format:\n",
      "     |          {'startpage': int, 'prefix': str, 'style': str, 'firstpagenum': int}.\n",
      "     |  \n",
      "     |  get_page_numbers(doc, label, only_one=False)\n",
      "     |      Return a list of page numbers with the given label.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          doc: PDF document object (resp. 'self').\n",
      "     |          label: (str) label.\n",
      "     |          only_one: (bool) stop searching after first hit.\n",
      "     |      Returns:\n",
      "     |          List of page numbers having this label.\n",
      "     |  \n",
      "     |  get_page_pixmap(doc: fitz.Document, pno: int, *, matrix: 'matrix_like' = IdentityMatrix(1.0, 0.0, 0.0, 1.0, 0.0, 0.0), dpi=None, colorspace: fitz.Colorspace = Colorspace(CS_RGB) - DeviceRGB, clip: 'rect_like' = None, alpha: bool = False, annots: bool = True) -> fitz.Pixmap\n",
      "     |      Create pixmap of document page by page number.\n",
      "     |      \n",
      "     |      Notes:\n",
      "     |          Convenience function calling page.get_pixmap.\n",
      "     |      Args:\n",
      "     |          pno: (int) page number\n",
      "     |          matrix: fitz.Matrix for transformation (default: fitz.Identity).\n",
      "     |          colorspace: (str,fitz.Colorspace) rgb, rgb, gray - case ignored, default csRGB.\n",
      "     |          clip: (irect-like) restrict rendering to this area.\n",
      "     |          alpha: (bool) include alpha channel\n",
      "     |          annots: (bool) also render annotations\n",
      "     |  \n",
      "     |  get_page_text(doc: fitz.Document, pno: int, option: str = 'text', clip: 'rect_like' = None, flags: Optional[int] = None, textpage: fitz.TextPage = None, sort: bool = False) -> Any\n",
      "     |      Extract a document page's text by page number.\n",
      "     |      \n",
      "     |      Notes:\n",
      "     |          Convenience function calling page.get_text().\n",
      "     |      Args:\n",
      "     |          pno: page number\n",
      "     |          option: (str) text, words, blocks, html, dict, json, rawdict, xhtml or xml.\n",
      "     |      Returns:\n",
      "     |          output from page.TextPage().\n",
      "     |  \n",
      "     |  get_page_xobjects(self, pno: int) -> list\n",
      "     |      Retrieve a list of XObjects used on a page.\n",
      "     |  \n",
      "     |  get_sigflags(self)\n",
      "     |      Get the /SigFlags value.\n",
      "     |  \n",
      "     |  get_toc(doc: fitz.Document, simple: bool = True) -> list\n",
      "     |      Create a table of contents.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          simple: a bool to control output. Returns a list, where each entry consists of outline level, title, page number and link destination (if simple = False). For details see PyMuPDF's documentation.\n",
      "     |  \n",
      "     |  get_xml_metadata(self)\n",
      "     |      Get document XML metadata.\n",
      "     |  \n",
      "     |  has_annots(doc: fitz.Document) -> bool\n",
      "     |      Check whether there are annotations on any page.\n",
      "     |  \n",
      "     |  has_links(doc: fitz.Document) -> bool\n",
      "     |      Check whether there are links on any page.\n",
      "     |  \n",
      "     |  init_doc(self)\n",
      "     |  \n",
      "     |  insert_file(self, infile, from_page=-1, to_page=-1, start_at=-1, rotate=-1, links=True, annots=True, show_progress=0, final=1)\n",
      "     |      Insert an arbitrary supported document to an existing PDF.\n",
      "     |      \n",
      "     |      The infile may be given as a filename, a Document or a Pixmap.\n",
      "     |      Other paramters - where applicable - equal those of insert_pdf().\n",
      "     |  \n",
      "     |  insert_page(doc: fitz.Document, pno: int, text: Union[str, list, NoneType] = None, fontsize: float = 11, width: float = 595, height: float = 842, fontname: str = 'helv', fontfile: Optional[str] = None, color: Optional[Sequence] = (0,)) -> int\n",
      "     |      Create a new PDF page and insert some text.\n",
      "     |      \n",
      "     |      Notes:\n",
      "     |          Function combining fitz.Document.new_page() and fitz.Page.insert_text().\n",
      "     |          For parameter details see these methods.\n",
      "     |  \n",
      "     |  insert_pdf(self, docsrc, from_page=-1, to_page=-1, start_at=-1, rotate=-1, links=1, annots=1, show_progress=0, final=1, _gmap=None)\n",
      "     |      Insert a page range from another PDF.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          docsrc: PDF to copy from. Must be different object, but may be same file.\n",
      "     |          from_page: (int) first source page to copy, 0-based, default 0.\n",
      "     |          to_page: (int) last source page to copy, 0-based, default last page.\n",
      "     |          start_at: (int) from_page will become this page number in target.\n",
      "     |          rotate: (int) rotate copied pages, default -1 is no change.\n",
      "     |          links: (int/bool) whether to also copy links.\n",
      "     |          annots: (int/bool) whether to also copy annotations.\n",
      "     |          show_progress: (int) progress message interval, 0 is no messages.\n",
      "     |          final: (bool) indicates last insertion from this source PDF.\n",
      "     |          _gmap: internal use only\n",
      "     |      \n",
      "     |      Copy sequence reversed if from_page > to_page.\n",
      "     |  \n",
      "     |  is_stream = xref_is_stream(self, xref=0)\n",
      "     |  \n",
      "     |  journal_can_do(self)\n",
      "     |      Show if undo and / or redo are possible.\n",
      "     |  \n",
      "     |  journal_enable(self)\n",
      "     |      Activate document journalling.\n",
      "     |  \n",
      "     |  journal_is_enabled(self)\n",
      "     |      Check if journalling is enabled.\n",
      "     |  \n",
      "     |  journal_load(self, filename)\n",
      "     |      Load a journal from a file.\n",
      "     |  \n",
      "     |  journal_op_name(self, step)\n",
      "     |      Show operation name for given step.\n",
      "     |  \n",
      "     |  journal_position(self)\n",
      "     |      Show journalling state.\n",
      "     |  \n",
      "     |  journal_redo(self)\n",
      "     |      Move forward in the journal.\n",
      "     |  \n",
      "     |  journal_save(self, filename)\n",
      "     |      Save journal to a file.\n",
      "     |  \n",
      "     |  journal_start_op(self, name=None)\n",
      "     |      Begin a journalling operation.\n",
      "     |  \n",
      "     |  journal_stop_op(self)\n",
      "     |      End a journalling operation.\n",
      "     |  \n",
      "     |  journal_undo(self)\n",
      "     |      Move backwards in the journal.\n",
      "     |  \n",
      "     |  layer_ui_configs(self)\n",
      "     |      Show OC visibility status modifiable by user.\n",
      "     |  \n",
      "     |  layout(self, rect=None, width=0, height=0, fontsize=11)\n",
      "     |      Re-layout a reflowable document.\n",
      "     |  \n",
      "     |  load_page(self, page_id)\n",
      "     |      Load a page.\n",
      "     |      \n",
      "     |      'page_id' is either a 0-based page number or a tuple (chapter, pno),\n",
      "     |      with chapter number and page number within that chapter.\n",
      "     |  \n",
      "     |  location_from_page_number(self, pno)\n",
      "     |      Convert pno to (chapter, page).\n",
      "     |  \n",
      "     |  make_bookmark(self, loc)\n",
      "     |      Make a page pointer before layouting document.\n",
      "     |  \n",
      "     |  move_page(self, pno: int, to: int = -1)\n",
      "     |      Move a page within a PDF document.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          pno: source page number.\n",
      "     |          to: put before this page, '-1' means after last page.\n",
      "     |  \n",
      "     |  need_appearances(self, value=None)\n",
      "     |      Get/set the NeedAppearances value.\n",
      "     |  \n",
      "     |  new_page(doc: fitz.Document, pno: int = -1, width: float = 595, height: float = 842) -> fitz.Page\n",
      "     |      Create and return a new page object.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          pno: (int) insert before this page. Default: after last page.\n",
      "     |          width: (float) page width in points. Default: 595 (ISO A4 width).\n",
      "     |          height: (float) page height in points. Default 842 (ISO A4 height).\n",
      "     |      Returns:\n",
      "     |          A fitz.Page object.\n",
      "     |  \n",
      "     |  next_location(self, page_id)\n",
      "     |      Get (chapter, page) of next page.\n",
      "     |  \n",
      "     |  page_annot_xrefs(self, n)\n",
      "     |  \n",
      "     |  page_cropbox(self, pno)\n",
      "     |      Get CropBox of page number (without loading page).\n",
      "     |  \n",
      "     |  page_number_from_location(self, page_id)\n",
      "     |      Convert (chapter, pno) to page number.\n",
      "     |  \n",
      "     |  page_xref(self, pno)\n",
      "     |      Get xref of page number.\n",
      "     |  \n",
      "     |  pages(self, start: Optional[int] = None, stop: Optional[int] = None, step: Optional[int] = None) -> 'Page_forward_decl'\n",
      "     |      Return a generator iterator over a page range.\n",
      "     |      \n",
      "     |      Arguments have the same meaning as for the range() built-in.\n",
      "     |  \n",
      "     |  pdf_catalog(self)\n",
      "     |      Get xref of PDF catalog.\n",
      "     |  \n",
      "     |  pdf_trailer(self, compressed=0, ascii=0)\n",
      "     |      Get PDF trailer as a string.\n",
      "     |  \n",
      "     |  prev_location(self, page_id)\n",
      "     |      Get (chapter, page) of previous page.\n",
      "     |  \n",
      "     |  reload_page(self, page: 'Page_forward_decl') -> 'Page_forward_decl'\n",
      "     |      Make a fresh copy of a page.\n",
      "     |  \n",
      "     |  resolve_link(self, uri=None, chapters=0)\n",
      "     |      Calculate internal link destination.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          uri: (str) some Link.uri\n",
      "     |          chapters: (bool) whether to use (chapter, page) format\n",
      "     |      Returns:\n",
      "     |          (page_id, x, y) where x, y are point coordinates on the page.\n",
      "     |          page_id is either page number (if chapters=0), or (chapter, pno).\n",
      "     |  \n",
      "     |  resolve_names(self)\n",
      "     |      Convert the PDF's destination names into a Python dict.\n",
      "     |      \n",
      "     |      This function must be used with PyMuPDF's new, \"rebased\" architecture -\n",
      "     |      see the above import statement.\n",
      "     |      \n",
      "     |      The only parameter is the fitz.Document.\n",
      "     |      All names found in the catalog under keys \"/Dests\" and \"/Names/Dests\" are\n",
      "     |      being included.\n",
      "     |      \n",
      "     |      Returns:\n",
      "     |          A dcitionary with the following layout:\n",
      "     |          - key: (str) the name\n",
      "     |          - value: (dict) with the following layout:\n",
      "     |              * \"page\":  target page number (0-based). If no page number found -1.\n",
      "     |              * \"to\": (x, y) target point on page - currently in PDF coordinates,\n",
      "     |                      i.e. point (0,0) is the bottom-left of the page.\n",
      "     |              * \"zoom\": (float) the zoom factor\n",
      "     |              * \"dest\": (str) only occurs if the target location on the page has\n",
      "     |                      not been provided as \"/XYZ\" or if no page number was found.\n",
      "     |          Examples:\n",
      "     |          {'__bookmark_1': {'page': 0, 'to': (0.0, 541.0), 'zoom': 0.0},\n",
      "     |          '__bookmark_2': {'page': 0, 'to': (0.0, 481.45), 'zoom': 0.0}}\n",
      "     |      \n",
      "     |          or\n",
      "     |      \n",
      "     |          '21154a7c20684ceb91f9c9adc3b677c40': {'page': -1, 'dest': '/XYZ 15.75 1486 0'}, ...\n",
      "     |  \n",
      "     |  save(self, filename, garbage=0, clean=0, deflate=0, deflate_images=0, deflate_fonts=0, incremental=0, ascii=0, expand=0, linear=0, no_new_id=0, appearance=0, pretty=0, encryption=1, permissions=4095, owner_pw=None, user_pw=None, preserve_metadata=1, use_objstms=0, compression_effort=0)\n",
      "     |      Save PDF to file, pathlib.Path or file pointer.\n",
      "     |  \n",
      "     |  saveIncr(self)\n",
      "     |      Save PDF incrementally\n",
      "     |  \n",
      "     |  save_snapshot(self, filename)\n",
      "     |      Save a file snapshot suitable for journalling.\n",
      "     |  \n",
      "     |  scrub(doc: fitz.Document, attached_files: bool = True, clean_pages: bool = True, embedded_files: bool = True, hidden_text: bool = True, javascript: bool = True, metadata: bool = True, redactions: bool = True, redact_images: int = 0, remove_links: bool = True, reset_fields: bool = True, reset_responses: bool = True, thumbnails: bool = True, xml_metadata: bool = True) -> None\n",
      "     |      # ------------------------------------------------------------------------------\n",
      "     |      # Remove potentially sensitive data from a PDF. Similar to the Adobe\n",
      "     |      # Acrobat 'sanitize' function\n",
      "     |      # ------------------------------------------------------------------------------\n",
      "     |  \n",
      "     |  search_page_for(doc: fitz.Document, pno: int, text: str, quads: bool = False, clip: 'rect_like' = None, flags: int = 83, textpage: fitz.TextPage = None) -> list\n",
      "     |      Search for a string on a page.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          pno: page number\n",
      "     |          text: string to be searched for\n",
      "     |          clip: restrict search to this rectangle\n",
      "     |          quads: (bool) return quads instead of rectangles\n",
      "     |          flags: bit switches, default: join hyphened words\n",
      "     |          textpage: reuse a prepared textpage\n",
      "     |      Returns:\n",
      "     |          a list of rectangles or quads, each containing an occurrence.\n",
      "     |  \n",
      "     |  select(self, pyliste)\n",
      "     |      Build sub-pdf with page numbers in the list.\n",
      "     |  \n",
      "     |  set_language(self, language=None)\n",
      "     |  \n",
      "     |  set_layer(self, config, basestate=None, on=None, off=None, rbgroups=None, locked=None)\n",
      "     |      Set the PDF keys /ON, /OFF, /RBGroups of an OC layer.\n",
      "     |  \n",
      "     |  set_layer_ui_config(self, number, action=0)\n",
      "     |      Set / unset OC intent configuration.\n",
      "     |  \n",
      "     |  set_markinfo(self, markinfo: dict) -> bool\n",
      "     |      Set the PDF MarkInfo values.\n",
      "     |  \n",
      "     |  set_metadata(doc: fitz.Document, m: dict) -> None\n",
      "     |      Update the PDF /Info object.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          m: a dictionary like doc.metadata.\n",
      "     |  \n",
      "     |  set_oc(doc: fitz.Document, xref: int, oc: int) -> None\n",
      "     |      Attach optional content object to image or form xobject.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          xref: (int) xref number of an image or form xobject\n",
      "     |          oc: (int) xref number of an OCG or OCMD\n",
      "     |  \n",
      "     |  set_ocmd(doc: fitz.Document, xref: int = 0, ocgs: Optional[list] = None, policy: Optional[str] = None, ve: Optional[list] = None) -> int\n",
      "     |      Create or update an OCMD object in a PDF document.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          xref: (int) 0 for creating a new object, otherwise update existing one.\n",
      "     |          ocgs: (list) OCG xref numbers, which shall be subject to 'policy'.\n",
      "     |          policy: one of 'AllOn', 'AllOff', 'AnyOn', 'AnyOff' (any casing).\n",
      "     |          ve: (list) visibility expression. Use instead of 'ocgs' with 'policy'.\n",
      "     |      \n",
      "     |      Returns:\n",
      "     |          Xref of the created or updated OCMD.\n",
      "     |  \n",
      "     |  set_page_labels(doc, labels)\n",
      "     |      Add / replace page label definitions in PDF document.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          doc: PDF document (resp. 'self').\n",
      "     |          labels: list of label dictionaries like:\n",
      "     |          {'startpage': int, 'prefix': str, 'style': str, 'firstpagenum': int},\n",
      "     |          as returned by get_page_labels().\n",
      "     |  \n",
      "     |  set_pagelayout(self, pagelayout: str)\n",
      "     |      Set the PDF PageLayout value.\n",
      "     |  \n",
      "     |  set_pagemode(self, pagemode: str)\n",
      "     |      Set the PDF PageMode value.\n",
      "     |  \n",
      "     |  set_toc(doc: fitz.Document, toc: list, collapse: int = 1) -> int\n",
      "     |      Create new outline tree (table of contents, TOC).\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          toc: (list, tuple) each entry must contain level, title, page and\n",
      "     |              optionally top margin on the page. None or '()' remove the TOC.\n",
      "     |          collapse: (int) collapses entries beyond this level. Zero or None\n",
      "     |              shows all entries unfolded.\n",
      "     |      Returns:\n",
      "     |          the number of inserted items, or the number of removed items respectively.\n",
      "     |  \n",
      "     |  set_toc_item(doc: fitz.Document, idx: int, dest_dict: Optional[dict] = None, kind: Optional[int] = None, pno: Optional[int] = None, uri: Optional[str] = None, title: Optional[str] = None, to: 'point_like' = None, filename: Optional[str] = None, zoom: float = 0) -> None\n",
      "     |      Update TOC item by index.\n",
      "     |      \n",
      "     |      It allows changing the item's title and link destination.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          idx: (int) desired index of the TOC list, as created by get_toc.\n",
      "     |          dest_dict: (dict) destination dictionary as created by get_toc(False).\n",
      "     |              Outrules all other parameters. If None, the remaining parameters\n",
      "     |              are used to make a dest dictionary.\n",
      "     |          kind: (int) kind of link (fitz.LINK_GOTO, etc.). If None, then only the\n",
      "     |              title will be updated. If fitz.LINK_NONE, the TOC item will be deleted.\n",
      "     |          pno: (int) page number (1-based like in get_toc). Required if fitz.LINK_GOTO.\n",
      "     |          uri: (str) the URL, required if fitz.LINK_URI.\n",
      "     |          title: (str) the new title. No change if None.\n",
      "     |          to: (point-like) destination on the target page. If omitted, (72, 36)\n",
      "     |              will be used as taget coordinates.\n",
      "     |          filename: (str) destination filename, required for fitz.LINK_GOTOR and\n",
      "     |              fitz.LINK_LAUNCH.\n",
      "     |          name: (str) a destination name for fitz.LINK_NAMED.\n",
      "     |          zoom: (float) a zoom factor for the target location (fitz.LINK_GOTO).\n",
      "     |  \n",
      "     |  set_xml_metadata(self, metadata)\n",
      "     |      Store XML document level metadata.\n",
      "     |  \n",
      "     |  subset_fonts(doc: fitz.Document, verbose: bool = False) -> None\n",
      "     |      Build font subsets of a PDF. Requires package 'fontTools'.\n",
      "     |      \n",
      "     |      Eligible fonts are potentially replaced by smaller versions. Page text is\n",
      "     |      NOT rewritten and thus should retain properties like being hidden or\n",
      "     |      controlled by optional content.\n",
      "     |  \n",
      "     |  switch_layer(self, config, as_default=0)\n",
      "     |      Activate an OC layer.\n",
      "     |  \n",
      "     |  tobytes = write(self, garbage=False, clean=False, deflate=False, deflate_images=False, deflate_fonts=False, incremental=False, ascii=False, expand=False, linear=False, no_new_id=False, appearance=False, pretty=False, encryption=1, permissions=4095, owner_pw=None, user_pw=None, preserve_metadata=1, use_objstms=0, compression_effort=0)\n",
      "     |  \n",
      "     |  update_object(self, xref, text, page=None)\n",
      "     |      Replace object definition source.\n",
      "     |  \n",
      "     |  update_stream(self, xref=0, stream=None, new=1, compress=1)\n",
      "     |      Replace xref stream part.\n",
      "     |  \n",
      "     |  write(self, garbage=False, clean=False, deflate=False, deflate_images=False, deflate_fonts=False, incremental=False, ascii=False, expand=False, linear=False, no_new_id=False, appearance=False, pretty=False, encryption=1, permissions=4095, owner_pw=None, user_pw=None, preserve_metadata=1, use_objstms=0, compression_effort=0)\n",
      "     |  \n",
      "     |  xref_copy(doc: fitz.Document, source: int, target: int, *, keep: list = None) -> None\n",
      "     |      Copy a PDF dictionary object to another one given their xref numbers.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          doc: PDF document object\n",
      "     |          source: source xref number\n",
      "     |          target: target xref number, the xref must already exist\n",
      "     |          keep: an optional list of 1st level keys in target that should not be\n",
      "     |                removed before copying.\n",
      "     |      Notes:\n",
      "     |          This works similar to the copy() method of dictionaries in Python. The\n",
      "     |          source may be a stream object.\n",
      "     |  \n",
      "     |  xref_get_key(self, xref, key)\n",
      "     |      Get PDF dict key value of object at 'xref'.\n",
      "     |  \n",
      "     |  xref_get_keys(self, xref)\n",
      "     |      Get the keys of PDF dict object at 'xref'. Use -1 for the PDF trailer.\n",
      "     |  \n",
      "     |  xref_is_font(self, xref)\n",
      "     |      Check if xref is a font object.\n",
      "     |  \n",
      "     |  xref_is_image(self, xref)\n",
      "     |      Check if xref is an image object.\n",
      "     |  \n",
      "     |  xref_is_stream(self, xref=0)\n",
      "     |      Check if xref is a stream object.\n",
      "     |  \n",
      "     |  xref_is_xobject(self, xref)\n",
      "     |      Check if xref is a form xobject.\n",
      "     |  \n",
      "     |  xref_length(self)\n",
      "     |      Get length of xref table.\n",
      "     |  \n",
      "     |  xref_object(self, xref, compressed=0, ascii=0)\n",
      "     |      Get xref object source as a string.\n",
      "     |  \n",
      "     |  xref_set_key(self, xref, key, value)\n",
      "     |      Set the value of a PDF dictionary key.\n",
      "     |  \n",
      "     |  xref_stream(self, xref)\n",
      "     |      Get decompressed xref stream.\n",
      "     |  \n",
      "     |  xref_stream_raw(self, xref)\n",
      "     |      Get xref stream without decompression.\n",
      "     |  \n",
      "     |  xref_xml_metadata(self)\n",
      "     |      Get xref of document XML metadata.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties defined here:\n",
      "     |  \n",
      "     |  FormFonts\n",
      "     |      Get list of field font resource names.\n",
      "     |  \n",
      "     |  chapter_count\n",
      "     |      Number of chapters.\n",
      "     |  \n",
      "     |  is_dirty\n",
      "     |  \n",
      "     |  is_fast_webaccess\n",
      "     |      Check whether we have a linearized PDF.\n",
      "     |  \n",
      "     |  is_form_pdf\n",
      "     |      Either False or PDF field count.\n",
      "     |  \n",
      "     |  is_pdf\n",
      "     |      Check for PDF.\n",
      "     |  \n",
      "     |  is_reflowable\n",
      "     |      Check if document is layoutable.\n",
      "     |  \n",
      "     |  is_repaired\n",
      "     |      Check whether PDF was repaired.\n",
      "     |  \n",
      "     |  language\n",
      "     |      Document language.\n",
      "     |  \n",
      "     |  last_location\n",
      "     |      Id (chapter, page) of last page.\n",
      "     |  \n",
      "     |  markinfo\n",
      "     |      Return the PDF MarkInfo value.\n",
      "     |  \n",
      "     |  metadata\n",
      "     |  \n",
      "     |  name\n",
      "     |  \n",
      "     |  needs_pass\n",
      "     |      Indicate password required.\n",
      "     |  \n",
      "     |  outline\n",
      "     |  \n",
      "     |  page_count\n",
      "     |      Number of pages.\n",
      "     |  \n",
      "     |  pagelayout\n",
      "     |      Return the PDF PageLayout value.\n",
      "     |  \n",
      "     |  pagemode\n",
      "     |      Return the PDF PageMode value.\n",
      "     |  \n",
      "     |  permissions\n",
      "     |      Document permissions.\n",
      "     |  \n",
      "     |  version_count\n",
      "     |      Count versions of PDF document.\n",
      "     |  \n",
      "     |  xref\n",
      "     |      PDF xref number of page.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  page_count2\n",
      "     |  \n",
      "     |  this\n",
      "     |  \n",
      "     |  this_is_pdf\n",
      "    \n",
      "    class DocumentWriter(builtins.object)\n",
      "     |  DocumentWriter(path, options='')\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __enter__(self)\n",
      "     |  \n",
      "     |  __exit__(self, *args)\n",
      "     |  \n",
      "     |  __init__(self, path, options='')\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  begin_page(self, mediabox)\n",
      "     |  \n",
      "     |  close(self)\n",
      "     |  \n",
      "     |  end_page(self)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class ElementPosition(builtins.object)\n",
      "     |  Convert a dictionary with element position information to an object.\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class EmptyFileError(FileDataError)\n",
      "     |  Raised when creating documents from zero-length data.\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      EmptyFileError\n",
      "     |      FileDataError\n",
      "     |      builtins.RuntimeError\n",
      "     |      builtins.Exception\n",
      "     |      builtins.BaseException\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Data descriptors inherited from FileDataError:\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from builtins.RuntimeError:\n",
      "     |  \n",
      "     |  __init__(self, /, *args, **kwargs)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods inherited from builtins.RuntimeError:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from builtins.BaseException:\n",
      "     |  \n",
      "     |  __delattr__(self, name, /)\n",
      "     |      Implement delattr(self, name).\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      Helper for pickle.\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __setattr__(self, name, value, /)\n",
      "     |      Implement setattr(self, name, value).\n",
      "     |  \n",
      "     |  __setstate__(...)\n",
      "     |  \n",
      "     |  __str__(self, /)\n",
      "     |      Return str(self).\n",
      "     |  \n",
      "     |  with_traceback(...)\n",
      "     |      Exception.with_traceback(tb) --\n",
      "     |      set self.__traceback__ to tb and return self.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from builtins.BaseException:\n",
      "     |  \n",
      "     |  __cause__\n",
      "     |      exception cause\n",
      "     |  \n",
      "     |  __context__\n",
      "     |      exception context\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |  \n",
      "     |  __suppress_context__\n",
      "     |  \n",
      "     |  __traceback__\n",
      "     |  \n",
      "     |  args\n",
      "    \n",
      "    class FileDataError(builtins.RuntimeError)\n",
      "     |  Raised for documents with file structure issues.\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      FileDataError\n",
      "     |      builtins.RuntimeError\n",
      "     |      builtins.Exception\n",
      "     |      builtins.BaseException\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from builtins.RuntimeError:\n",
      "     |  \n",
      "     |  __init__(self, /, *args, **kwargs)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods inherited from builtins.RuntimeError:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from builtins.BaseException:\n",
      "     |  \n",
      "     |  __delattr__(self, name, /)\n",
      "     |      Implement delattr(self, name).\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      Helper for pickle.\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __setattr__(self, name, value, /)\n",
      "     |      Implement setattr(self, name, value).\n",
      "     |  \n",
      "     |  __setstate__(...)\n",
      "     |  \n",
      "     |  __str__(self, /)\n",
      "     |      Return str(self).\n",
      "     |  \n",
      "     |  with_traceback(...)\n",
      "     |      Exception.with_traceback(tb) --\n",
      "     |      set self.__traceback__ to tb and return self.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from builtins.BaseException:\n",
      "     |  \n",
      "     |  __cause__\n",
      "     |      exception cause\n",
      "     |  \n",
      "     |  __context__\n",
      "     |      exception context\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |  \n",
      "     |  __suppress_context__\n",
      "     |  \n",
      "     |  __traceback__\n",
      "     |  \n",
      "     |  args\n",
      "    \n",
      "    class FileNotFoundError(builtins.RuntimeError)\n",
      "     |  Raised if file does not exist.\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      FileNotFoundError\n",
      "     |      builtins.RuntimeError\n",
      "     |      builtins.Exception\n",
      "     |      builtins.BaseException\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from builtins.RuntimeError:\n",
      "     |  \n",
      "     |  __init__(self, /, *args, **kwargs)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods inherited from builtins.RuntimeError:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from builtins.BaseException:\n",
      "     |  \n",
      "     |  __delattr__(self, name, /)\n",
      "     |      Implement delattr(self, name).\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      Helper for pickle.\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __setattr__(self, name, value, /)\n",
      "     |      Implement setattr(self, name, value).\n",
      "     |  \n",
      "     |  __setstate__(...)\n",
      "     |  \n",
      "     |  __str__(self, /)\n",
      "     |      Return str(self).\n",
      "     |  \n",
      "     |  with_traceback(...)\n",
      "     |      Exception.with_traceback(tb) --\n",
      "     |      set self.__traceback__ to tb and return self.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from builtins.BaseException:\n",
      "     |  \n",
      "     |  __cause__\n",
      "     |      exception cause\n",
      "     |  \n",
      "     |  __context__\n",
      "     |      exception context\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |  \n",
      "     |  __suppress_context__\n",
      "     |  \n",
      "     |  __traceback__\n",
      "     |  \n",
      "     |  args\n",
      "    \n",
      "    class FitzDeprecation(builtins.DeprecationWarning)\n",
      "     |  Method resolution order:\n",
      "     |      FitzDeprecation\n",
      "     |      builtins.DeprecationWarning\n",
      "     |      builtins.Warning\n",
      "     |      builtins.Exception\n",
      "     |      builtins.BaseException\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from builtins.DeprecationWarning:\n",
      "     |  \n",
      "     |  __init__(self, /, *args, **kwargs)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods inherited from builtins.DeprecationWarning:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from builtins.BaseException:\n",
      "     |  \n",
      "     |  __delattr__(self, name, /)\n",
      "     |      Implement delattr(self, name).\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      Helper for pickle.\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __setattr__(self, name, value, /)\n",
      "     |      Implement setattr(self, name, value).\n",
      "     |  \n",
      "     |  __setstate__(...)\n",
      "     |  \n",
      "     |  __str__(self, /)\n",
      "     |      Return str(self).\n",
      "     |  \n",
      "     |  with_traceback(...)\n",
      "     |      Exception.with_traceback(tb) --\n",
      "     |      set self.__traceback__ to tb and return self.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from builtins.BaseException:\n",
      "     |  \n",
      "     |  __cause__\n",
      "     |      exception cause\n",
      "     |  \n",
      "     |  __context__\n",
      "     |      exception context\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |  \n",
      "     |  __suppress_context__\n",
      "     |  \n",
      "     |  __traceback__\n",
      "     |  \n",
      "     |  args\n",
      "    \n",
      "    class Font(builtins.object)\n",
      "     |  Font(fontname=None, fontfile=None, fontbuffer=None, script=0, language=None, ordering=-1, is_bold=0, is_italic=0, is_serif=0, embed=1)\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __del__(self)\n",
      "     |  \n",
      "     |  __init__(self, fontname=None, fontfile=None, fontbuffer=None, script=0, language=None, ordering=-1, is_bold=0, is_italic=0, is_serif=0, embed=1)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  __repr__(self)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  char_lengths(self, text, fontsize=11, language=None, script=0, wmode=0, small_caps=0)\n",
      "     |      Return tuple of char lengths of unicode 'text' under a fontsize.\n",
      "     |  \n",
      "     |  glyph_advance(self, chr_, language=None, script=0, wmode=0, small_caps=0)\n",
      "     |      Return the glyph width of a unicode (font size 1).\n",
      "     |  \n",
      "     |  glyph_bbox(self, char, language=None, script=0, small_caps=0)\n",
      "     |      Return the glyph bbox of a unicode (font size 1).\n",
      "     |  \n",
      "     |  glyph_name_to_unicode(self, name)\n",
      "     |      Return the unicode for a glyph name.\n",
      "     |  \n",
      "     |  has_glyph(self, chr, language=None, script=0, fallback=0, small_caps=0)\n",
      "     |      Check whether font has a glyph for this unicode.\n",
      "     |  \n",
      "     |  text_length(self, text, fontsize=11, language=None, script=0, wmode=0, small_caps=0)\n",
      "     |      Return length of unicode 'text' under a fontsize.\n",
      "     |  \n",
      "     |  unicode_to_glyph_name(self, ch)\n",
      "     |      Return the glyph name for a unicode.\n",
      "     |  \n",
      "     |  valid_codepoints(self)\n",
      "     |      list of valid unicodes of a fz_font\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties defined here:\n",
      "     |  \n",
      "     |  ascender\n",
      "     |      Return the glyph ascender value.\n",
      "     |  \n",
      "     |  bbox\n",
      "     |  \n",
      "     |  buffer\n",
      "     |  \n",
      "     |  descender\n",
      "     |      Return the glyph descender value.\n",
      "     |  \n",
      "     |  flags\n",
      "     |  \n",
      "     |  glyph_count\n",
      "     |  \n",
      "     |  is_bold\n",
      "     |  \n",
      "     |  is_italic\n",
      "     |  \n",
      "     |  is_monospaced\n",
      "     |  \n",
      "     |  is_serif\n",
      "     |  \n",
      "     |  is_writable\n",
      "     |  \n",
      "     |  name\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class Graftmap(builtins.object)\n",
      "     |  Graftmap(doc)\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __del__(self)\n",
      "     |  \n",
      "     |  __init__(self, doc)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class IRect(builtins.object)\n",
      "     |  IRect(*args, p0=None, p1=None, x0=None, y0=None, x1=None, y1=None)\n",
      "     |  \n",
      "     |  IRect() - all zeros\n",
      "     |  IRect(x0, y0, x1, y1) - 4 coordinates\n",
      "     |  IRect(top-left, x1, y1) - point and 2 coordinates\n",
      "     |  IRect(x0, y0, bottom-right) - 2 coordinates and point\n",
      "     |  IRect(top-left, bottom-right) - 2 points\n",
      "     |  IRect(sequ) - new from sequence or rect-like\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __add__(self, p)\n",
      "     |  \n",
      "     |  __and__(self, x)\n",
      "     |  \n",
      "     |  __contains__(self, x)\n",
      "     |  \n",
      "     |  __eq__(self, r)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __getitem__(self, i)\n",
      "     |  \n",
      "     |  __init__(self, *args, p0=None, p1=None, x0=None, y0=None, x1=None, y1=None)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  __len__(self)\n",
      "     |  \n",
      "     |  __mul__(self, m)\n",
      "     |  \n",
      "     |  __neg__(self)\n",
      "     |  \n",
      "     |  __or__(self, x)\n",
      "     |  \n",
      "     |  __pos__(self)\n",
      "     |  \n",
      "     |  __repr__(self)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __setitem__(self, i, v)\n",
      "     |  \n",
      "     |  __sub__(self, p)\n",
      "     |  \n",
      "     |  __truediv__(self, m)\n",
      "     |  \n",
      "     |  get_area(*args) -> float\n",
      "     |      Calculate area of rectangle.\n",
      "     |      parameter is one of 'px' (default), 'in', 'cm', or 'mm'.\n",
      "     |  \n",
      "     |  include_point(self, p)\n",
      "     |      Extend rectangle to include point p.\n",
      "     |  \n",
      "     |  include_rect(self, r)\n",
      "     |      Extend rectangle to include rectangle r.\n",
      "     |  \n",
      "     |  intersect(self, r)\n",
      "     |      Restrict rectangle to intersection with rectangle r.\n",
      "     |  \n",
      "     |  intersects(self, x)\n",
      "     |  \n",
      "     |  morph(self, p, m)\n",
      "     |      Morph with matrix-like m and point-like p.\n",
      "     |      \n",
      "     |      Returns a new quad.\n",
      "     |  \n",
      "     |  norm(self)\n",
      "     |  \n",
      "     |  normalize(self)\n",
      "     |      Replace rectangle with its valid version.\n",
      "     |  \n",
      "     |  torect(self, r)\n",
      "     |      Return matrix that converts to target rect.\n",
      "     |  \n",
      "     |  transform(self, m)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties defined here:\n",
      "     |  \n",
      "     |  bl\n",
      "     |      Bottom-left corner.\n",
      "     |  \n",
      "     |  bottom_left\n",
      "     |      Bottom-left corner.\n",
      "     |  \n",
      "     |  bottom_right\n",
      "     |      Bottom-right corner.\n",
      "     |  \n",
      "     |  br\n",
      "     |      Bottom-right corner.\n",
      "     |  \n",
      "     |  height\n",
      "     |  \n",
      "     |  is_empty\n",
      "     |      True if rectangle area is empty.\n",
      "     |  \n",
      "     |  is_infinite\n",
      "     |      True if rectangle is infinite.\n",
      "     |  \n",
      "     |  is_valid\n",
      "     |      True if rectangle is valid.\n",
      "     |  \n",
      "     |  quad\n",
      "     |      Return Quad version of rectangle.\n",
      "     |  \n",
      "     |  rect\n",
      "     |  \n",
      "     |  tl\n",
      "     |      Top-left corner.\n",
      "     |  \n",
      "     |  top_left\n",
      "     |      Top-left corner.\n",
      "     |  \n",
      "     |  top_right\n",
      "     |      Top-right corner.\n",
      "     |  \n",
      "     |  tr\n",
      "     |      Top-right corner.\n",
      "     |  \n",
      "     |  width\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  __hash__ = None\n",
      "    \n",
      "    class IdentityMatrix(Matrix)\n",
      "     |  Identity matrix [1, 0, 0, 1, 0, 0]\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      IdentityMatrix\n",
      "     |      Matrix\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __hash__(self)\n",
      "     |      Return hash(self).\n",
      "     |  \n",
      "     |  __init__(self)\n",
      "     |      Matrix() - all zeros\n",
      "     |      Matrix(a, b, c, d, e, f)\n",
      "     |      Matrix(zoom-x, zoom-y) - zoom\n",
      "     |      Matrix(shear-x, shear-y, 1) - shear\n",
      "     |      Matrix(degree) - rotate\n",
      "     |      Matrix(Matrix) - new copy\n",
      "     |      Matrix(sequence) - from 'sequence'\n",
      "     |      Matrix(mupdf.FzMatrix) - from MuPDF class wrapper for fz_matrix.\n",
      "     |      \n",
      "     |      Explicit keyword args a, b, c, d, e, f override any earlier settings if\n",
      "     |      not None.\n",
      "     |  \n",
      "     |  __repr__(self)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __setattr__(self, name, value)\n",
      "     |      Implement setattr(self, name, value).\n",
      "     |  \n",
      "     |  checkargs(*args)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from Matrix:\n",
      "     |  \n",
      "     |  __abs__(self)\n",
      "     |  \n",
      "     |  __add__(self, m)\n",
      "     |  \n",
      "     |  __bool__(self)\n",
      "     |  \n",
      "     |  __div__ = __truediv__(self, m)\n",
      "     |  \n",
      "     |  __eq__(self, mat)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __getitem__(self, i)\n",
      "     |  \n",
      "     |  __inv__ = __invert__(self)\n",
      "     |  \n",
      "     |  __invert__(self)\n",
      "     |      Calculate inverted matrix.\n",
      "     |  \n",
      "     |  __len__(self)\n",
      "     |  \n",
      "     |  __mul__(self, m)\n",
      "     |  \n",
      "     |  __neg__(self)\n",
      "     |  \n",
      "     |  __nonzero__(self)\n",
      "     |  \n",
      "     |  __pos__(self)\n",
      "     |  \n",
      "     |  __setitem__(self, i, v)\n",
      "     |  \n",
      "     |  __sub__(self, m)\n",
      "     |  \n",
      "     |  __truediv__(self, m)\n",
      "     |  \n",
      "     |  concat(self, one, two)\n",
      "     |      Multiply two matrices and replace current one.\n",
      "     |  \n",
      "     |  invert(self, src=None)\n",
      "     |      Calculate the inverted matrix. Return 0 if successful and replace\n",
      "     |      current one. Else return 1 and do nothing.\n",
      "     |  \n",
      "     |  norm = __abs__(self)\n",
      "     |  \n",
      "     |  prerotate(self, theta)\n",
      "     |      Calculate pre rotation and replace current matrix.\n",
      "     |  \n",
      "     |  prescale(self, sx, sy)\n",
      "     |      Calculate pre scaling and replace current matrix.\n",
      "     |  \n",
      "     |  preshear(self, h, v)\n",
      "     |      Calculate pre shearing and replace current matrix.\n",
      "     |  \n",
      "     |  pretranslate(self, tx, ty)\n",
      "     |      Calculate pre translation and replace current matrix.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties inherited from Matrix:\n",
      "     |  \n",
      "     |  is_rectilinear\n",
      "     |      True if rectangles are mapped to rectangles.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from Matrix:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class JM_image_reporter_Filter(fitz.mupdf.PdfFilterOptions2)\n",
      "     |  Method resolution order:\n",
      "     |      JM_image_reporter_Filter\n",
      "     |      fitz.mupdf.PdfFilterOptions2\n",
      "     |      fitz.mupdf.PdfFilterOptions\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self)\n",
      "     |      == Constructor.\n",
      "     |  \n",
      "     |  image_filter(self, ctx, ctm, name, image)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from fitz.mupdf.PdfFilterOptions2:\n",
      "     |  \n",
      "     |  __disown__(self)\n",
      "     |  \n",
      "     |  __repr__ = _swig_repr(self)\n",
      "     |  \n",
      "     |  complete(self, arg_0, arg_1)\n",
      "     |      Default virtual method implementations; these all throw an exception.\n",
      "     |  \n",
      "     |  use_virtual_complete(self, use=True)\n",
      "     |      These methods set the function pointers in *m_internal\n",
      "     |      to point to internal callbacks that call our virtual methods.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods inherited from fitz.mupdf.PdfFilterOptions2:\n",
      "     |  \n",
      "     |  __swig_destroy__ = delete_PdfFilterOptions2(...)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from fitz.mupdf.PdfFilterOptions2:\n",
      "     |  \n",
      "     |  thisown\n",
      "     |      The membership flag\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from fitz.mupdf.PdfFilterOptions:\n",
      "     |  \n",
      "     |  __eq__(self, rhs)\n",
      "     |      Comparison method.\n",
      "     |  \n",
      "     |  __ne__(self, rhs)\n",
      "     |      Comparison method.\n",
      "     |  \n",
      "     |  __str__ lambda self\n",
      "     |  \n",
      "     |  add_factory(self, factory)\n",
      "     |      We use default copy constructor and operator=.  Appends `factory` to internal vector and updates this->filters.\n",
      "     |  \n",
      "     |  internal(self, *args)\n",
      "     |      *Overload 1:*\n",
      "     |      Access as underlying struct.\n",
      "     |      \n",
      "     |      |\n",
      "     |      \n",
      "     |      *Overload 2:*\n",
      "     |      Access as underlying struct.\n",
      "     |  \n",
      "     |  to_string(self)\n",
      "     |      Returns string containing our members, labelled and inside (...), using operator<<.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from fitz.mupdf.PdfFilterOptions:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  ascii\n",
      "     |  \n",
      "     |  filters\n",
      "     |  \n",
      "     |  instance_forms\n",
      "     |  \n",
      "     |  m_filters\n",
      "     |  \n",
      "     |  newlines\n",
      "     |  \n",
      "     |  no_update\n",
      "     |  \n",
      "     |  opaque\n",
      "     |  \n",
      "     |  recurse\n",
      "     |  \n",
      "     |  s_num_instances\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes inherited from fitz.mupdf.PdfFilterOptions:\n",
      "     |  \n",
      "     |  __hash__ = None\n",
      "    \n",
      "    class JM_new_bbox_device_Device(fitz.mupdf.FzDevice2)\n",
      "     |  JM_new_bbox_device_Device(result, layers)\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      JM_new_bbox_device_Device\n",
      "     |      fitz.mupdf.FzDevice2\n",
      "     |      fitz.mupdf.FzDevice\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, result, layers)\n",
      "     |      == Constructor.\n",
      "     |  \n",
      "     |  begin_layer = jm_lineart_begin_layer(dev, ctx, name)\n",
      "     |  \n",
      "     |  end_layer = jm_lineart_end_layer(dev, ctx)\n",
      "     |  \n",
      "     |  fill_image = jm_bbox_fill_image(dev, ctx, image, ctm, alpha, color_params)\n",
      "     |  \n",
      "     |  fill_image_mask = jm_bbox_fill_image_mask(dev, ctx, image, ctm, colorspace, color, alpha, color_params)\n",
      "     |  \n",
      "     |  fill_path = jm_bbox_fill_path(dev, ctx, path, even_odd, ctm, colorspace, color, alpha, color_params)\n",
      "     |  \n",
      "     |  fill_shade = jm_bbox_fill_shade(dev, ctx, shade, ctm, alpha, color_params)\n",
      "     |  \n",
      "     |  fill_text = jm_bbox_fill_text(dev, ctx, text, ctm, *args)\n",
      "     |  \n",
      "     |  ignore_text = jm_bbox_ignore_text(dev, ctx, text, ctm)\n",
      "     |  \n",
      "     |  stroke_path = jm_bbox_stroke_path(dev, ctx, path, stroke, ctm, colorspace, color, alpha, color_params)\n",
      "     |  \n",
      "     |  stroke_text = jm_bbox_stroke_text(dev, ctx, text, stroke, ctm, *args)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from fitz.mupdf.FzDevice2:\n",
      "     |  \n",
      "     |  __disown__(self)\n",
      "     |  \n",
      "     |  __repr__ = _swig_repr(self)\n",
      "     |  \n",
      "     |  begin_group(self, arg_0, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7)\n",
      "     |  \n",
      "     |  begin_mask(self, arg_0, arg_2, arg_3, arg_4, arg_5, arg_6)\n",
      "     |  \n",
      "     |  begin_metatext(self, arg_0, arg_2, arg_3)\n",
      "     |  \n",
      "     |  begin_structure(self, arg_0, arg_2, arg_3, arg_4)\n",
      "     |  \n",
      "     |  begin_tile(self, arg_0, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7)\n",
      "     |  \n",
      "     |  clip_image_mask(self, arg_0, arg_2, arg_3, arg_4)\n",
      "     |  \n",
      "     |  clip_path(self, arg_0, arg_2, arg_3, arg_4, arg_5)\n",
      "     |  \n",
      "     |  clip_stroke_path(self, arg_0, arg_2, arg_3, arg_4, arg_5)\n",
      "     |  \n",
      "     |  clip_stroke_text(self, arg_0, arg_2, arg_3, arg_4, arg_5)\n",
      "     |  \n",
      "     |  clip_text(self, arg_0, arg_2, arg_3, arg_4)\n",
      "     |  \n",
      "     |  close_device(self, arg_0)\n",
      "     |      Default virtual method implementations; these all throw an exception.\n",
      "     |  \n",
      "     |  drop_device(self, arg_0)\n",
      "     |  \n",
      "     |  end_group(self, arg_0)\n",
      "     |  \n",
      "     |  end_mask(self, arg_0, arg_2)\n",
      "     |  \n",
      "     |  end_metatext(self, arg_0)\n",
      "     |  \n",
      "     |  end_structure(self, arg_0)\n",
      "     |  \n",
      "     |  end_tile(self, arg_0)\n",
      "     |  \n",
      "     |  pop_clip(self, arg_0)\n",
      "     |  \n",
      "     |  render_flags(self, arg_0, arg_2, arg_3)\n",
      "     |  \n",
      "     |  set_default_colorspaces(self, arg_0, arg_2)\n",
      "     |  \n",
      "     |  use_virtual_begin_group(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_begin_layer(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_begin_mask(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_begin_metatext(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_begin_structure(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_begin_tile(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_clip_image_mask(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_clip_path(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_clip_stroke_path(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_clip_stroke_text(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_clip_text(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_close_device(self, use=True)\n",
      "     |      These methods set the function pointers in *m_internal\n",
      "     |      to point to internal callbacks that call our virtual methods.\n",
      "     |  \n",
      "     |  use_virtual_drop_device(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_end_group(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_end_layer(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_end_mask(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_end_metatext(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_end_structure(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_end_tile(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_fill_image(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_fill_image_mask(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_fill_path(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_fill_shade(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_fill_text(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_ignore_text(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_pop_clip(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_render_flags(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_set_default_colorspaces(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_stroke_path(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_stroke_text(self, use=True)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods inherited from fitz.mupdf.FzDevice2:\n",
      "     |  \n",
      "     |  __swig_destroy__ = delete_FzDevice2(...)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from fitz.mupdf.FzDevice2:\n",
      "     |  \n",
      "     |  thisown\n",
      "     |      The membership flag\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from fitz.mupdf.FzDevice:\n",
      "     |  \n",
      "     |  fz_begin_group(self, area, cs, isolated, knockout, blendmode, alpha)\n",
      "     |      Class-aware wrapper for `::fz_begin_group()`.\n",
      "     |  \n",
      "     |  fz_begin_layer(self, layer_name)\n",
      "     |      Class-aware wrapper for `::fz_begin_layer()`.\n",
      "     |  \n",
      "     |  fz_begin_mask(self, area, luminosity, colorspace, bc, color_params)\n",
      "     |      Class-aware wrapper for `::fz_begin_mask()`.\n",
      "     |  \n",
      "     |  fz_begin_metatext(self, meta, text)\n",
      "     |      Class-aware wrapper for `::fz_begin_metatext()`.\n",
      "     |  \n",
      "     |  fz_begin_structure(self, standard, raw, idx)\n",
      "     |      Class-aware wrapper for `::fz_begin_structure()`.\n",
      "     |  \n",
      "     |  fz_begin_tile(self, area, view, xstep, ystep, ctm)\n",
      "     |      Class-aware wrapper for `::fz_begin_tile()`.\n",
      "     |  \n",
      "     |  fz_begin_tile_id(self, area, view, xstep, ystep, ctm, id)\n",
      "     |      Class-aware wrapper for `::fz_begin_tile_id()`.\n",
      "     |  \n",
      "     |  fz_clip_image_mask(self, image, ctm, scissor)\n",
      "     |      Class-aware wrapper for `::fz_clip_image_mask()`.\n",
      "     |  \n",
      "     |  fz_clip_path(self, path, even_odd, ctm, scissor)\n",
      "     |      Class-aware wrapper for `::fz_clip_path()`.\n",
      "     |  \n",
      "     |  fz_clip_stroke_path(self, path, stroke, ctm, scissor)\n",
      "     |      Class-aware wrapper for `::fz_clip_stroke_path()`.\n",
      "     |  \n",
      "     |  fz_clip_stroke_text(self, text, stroke, ctm, scissor)\n",
      "     |      Class-aware wrapper for `::fz_clip_stroke_text()`.\n",
      "     |  \n",
      "     |  fz_clip_text(self, text, ctm, scissor)\n",
      "     |      Class-aware wrapper for `::fz_clip_text()`.\n",
      "     |  \n",
      "     |  fz_close_device(self)\n",
      "     |      Class-aware wrapper for `::fz_close_device()`.\n",
      "     |              Signal the end of input, and flush any buffered output.\n",
      "     |              This is NOT called implicitly on fz_drop_device. This\n",
      "     |              may throw exceptions.\n",
      "     |  \n",
      "     |  fz_device_current_scissor(self)\n",
      "     |      Class-aware wrapper for `::fz_device_current_scissor()`.\n",
      "     |              Find current scissor region as tracked by the device.\n",
      "     |  \n",
      "     |  fz_disable_device_hints(self, hints)\n",
      "     |      Class-aware wrapper for `::fz_disable_device_hints()`.\n",
      "     |              Disable (clear) hint bits within the hint bitfield for a device.\n",
      "     |  \n",
      "     |  fz_enable_device_hints(self, hints)\n",
      "     |      Class-aware wrapper for `::fz_enable_device_hints()`.\n",
      "     |              Enable (set) hint bits within the hint bitfield for a device.\n",
      "     |  \n",
      "     |  fz_end_group(self)\n",
      "     |      Class-aware wrapper for `::fz_end_group()`.\n",
      "     |  \n",
      "     |  fz_end_layer(self)\n",
      "     |      Class-aware wrapper for `::fz_end_layer()`.\n",
      "     |  \n",
      "     |  fz_end_mask(self)\n",
      "     |      Class-aware wrapper for `::fz_end_mask()`.\n",
      "     |  \n",
      "     |  fz_end_mask_tr(self, fn)\n",
      "     |      Class-aware wrapper for `::fz_end_mask_tr()`.\n",
      "     |  \n",
      "     |  fz_end_metatext(self)\n",
      "     |      Class-aware wrapper for `::fz_end_metatext()`.\n",
      "     |  \n",
      "     |  fz_end_structure(self)\n",
      "     |      Class-aware wrapper for `::fz_end_structure()`.\n",
      "     |  \n",
      "     |  fz_end_tile(self)\n",
      "     |      Class-aware wrapper for `::fz_end_tile()`.\n",
      "     |  \n",
      "     |  fz_fill_image(self, image, ctm, alpha, color_params)\n",
      "     |      Class-aware wrapper for `::fz_fill_image()`.\n",
      "     |  \n",
      "     |  fz_fill_image_mask(self, image, ctm, colorspace, color, alpha, color_params)\n",
      "     |      Class-aware wrapper for `::fz_fill_image_mask()`.\n",
      "     |  \n",
      "     |  fz_fill_path(self, path, even_odd, ctm, colorspace, color, alpha, color_params)\n",
      "     |      Class-aware wrapper for `::fz_fill_path()`.\n",
      "     |              Device calls; graphics primitives and containers.\n",
      "     |  \n",
      "     |  fz_fill_shade(self, shade, ctm, alpha, color_params)\n",
      "     |      Class-aware wrapper for `::fz_fill_shade()`.\n",
      "     |  \n",
      "     |  fz_fill_text(dev, text, ctm, colorspace, color, alpha, color_params)\n",
      "     |      Python version of fz_fill_text() taking list/tuple for `color`.\n",
      "     |  \n",
      "     |  fz_ignore_text(self, text, ctm)\n",
      "     |      Class-aware wrapper for `::fz_ignore_text()`.\n",
      "     |  \n",
      "     |  fz_new_ocr_device(self, ctm, mediabox, with_list, language, datadir, progress, progress_arg)\n",
      "     |      Class-aware wrapper for `::fz_new_ocr_device()`.\n",
      "     |              Create a device to OCR the text on the page.\n",
      "     |      \n",
      "     |              Renders the page internally to a bitmap that is then OCRd. Text\n",
      "     |              is then forwarded onto the target device.\n",
      "     |      \n",
      "     |              target: The target device to receive the OCRd text.\n",
      "     |      \n",
      "     |              ctm: The transform to apply to the mediabox to get the size for\n",
      "     |              the rendered page image. Also used to calculate the resolution\n",
      "     |              for the page image. In general, this will be the same as the CTM\n",
      "     |              that you pass to fz_run_page (or fz_run_display_list) to feed\n",
      "     |              this device.\n",
      "     |      \n",
      "     |              mediabox: The mediabox (in points). Combined with the CTM to get\n",
      "     |              the bounds of the pixmap used internally for the rendered page\n",
      "     |              image.\n",
      "     |      \n",
      "     |              with_list: If with_list is false, then all non-text operations\n",
      "     |              are forwarded instantly to the target device. This results in\n",
      "     |              the target device seeing all NON-text operations, followed by\n",
      "     |              all the text operations (derived from OCR).\n",
      "     |      \n",
      "     |              If with_list is true, then all the marking operations are\n",
      "     |              collated into a display list which is then replayed to the\n",
      "     |              target device at the end.\n",
      "     |      \n",
      "     |              language: NULL (for \"eng\"), or a pointer to a string to describe\n",
      "     |              the languages/scripts that should be used for OCR (e.g.\n",
      "     |              \"eng,ara\").\n",
      "     |      \n",
      "     |              datadir: NULL (for \"\"), or a pointer to a path string otherwise\n",
      "     |              provided to Tesseract in the TESSDATA_PREFIX environment variable.\n",
      "     |      \n",
      "     |              progress: NULL, or function to be called periodically to indicate\n",
      "     |              progress. Return 0 to continue, or 1 to cancel. progress_arg is\n",
      "     |              returned as the void *. The int is a value between 0 and 100 to\n",
      "     |              indicate progress.\n",
      "     |      \n",
      "     |              progress_arg: A void * value to be parrotted back to the progress\n",
      "     |              function.\n",
      "     |  \n",
      "     |  fz_pop_clip(self)\n",
      "     |      Class-aware wrapper for `::fz_pop_clip()`.\n",
      "     |  \n",
      "     |  fz_render_flags(self, set, clear)\n",
      "     |      Class-aware wrapper for `::fz_render_flags()`.\n",
      "     |  \n",
      "     |  fz_render_t3_glyph_direct(self, font, gid, trm, gstate, def_cs)\n",
      "     |      Class-aware wrapper for `::fz_render_t3_glyph_direct()`.\n",
      "     |              Nasty PDF interpreter specific hernia, required to allow the\n",
      "     |              interpreter to replay glyphs from a type3 font directly into\n",
      "     |              the target device.\n",
      "     |      \n",
      "     |              This is only used in exceptional circumstances (such as type3\n",
      "     |              glyphs that inherit current graphics state, or nested type3\n",
      "     |              glyphs).\n",
      "     |  \n",
      "     |  fz_set_default_colorspaces(self, default_cs)\n",
      "     |      Class-aware wrapper for `::fz_set_default_colorspaces()`.\n",
      "     |  \n",
      "     |  fz_stroke_path(self, path, stroke, ctm, colorspace, color, alpha, color_params)\n",
      "     |      Class-aware wrapper for `::fz_stroke_path()`.\n",
      "     |  \n",
      "     |  fz_stroke_text(self, text, stroke, ctm, colorspace, color, alpha, color_params)\n",
      "     |      Class-aware wrapper for `::fz_stroke_text()`.\n",
      "     |  \n",
      "     |  m_internal_value(self)\n",
      "     |      Return numerical value of .m_internal; helps with Python debugging.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods inherited from fitz.mupdf.FzDevice:\n",
      "     |  \n",
      "     |  fz_new_draw_device_type3(transform, dest)\n",
      "     |      Class-aware wrapper for `::fz_new_draw_device_type3()`.\n",
      "     |  \n",
      "     |  fz_new_xmltext_device(out)\n",
      "     |      Class-aware wrapper for `::fz_new_xmltext_device()`.\n",
      "     |              Create a device to output raw information.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from fitz.mupdf.FzDevice:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  m_internal\n",
      "     |      Pointer to wrapped data.\n",
      "     |  \n",
      "     |  s_num_instances\n",
      "    \n",
      "    class JM_new_lineart_device_Device(fitz.mupdf.FzDevice2)\n",
      "     |  JM_new_lineart_device_Device(out, clips, method)\n",
      "     |  \n",
      "     |  LINEART device for Python method Page.get_cdrawings()\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      JM_new_lineart_device_Device\n",
      "     |      fitz.mupdf.FzDevice2\n",
      "     |      fitz.mupdf.FzDevice\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, out, clips, method)\n",
      "     |      == Constructor.\n",
      "     |  \n",
      "     |  begin_group = jm_lineart_begin_group(dev, ctx, bbox, cs, isolated, knockout, blendmode, alpha)\n",
      "     |  \n",
      "     |  begin_layer = jm_lineart_begin_layer(dev, ctx, name)\n",
      "     |  \n",
      "     |  clip_image_mask = jm_lineart_clip_image_mask(dev, ctx, image, ctm, scissor)\n",
      "     |  \n",
      "     |  clip_path = jm_lineart_clip_path(dev, ctx, path, even_odd, ctm, scissor)\n",
      "     |  \n",
      "     |  clip_stroke_path = jm_lineart_clip_stroke_path(dev, ctx, path, stroke, ctm, scissor)\n",
      "     |  \n",
      "     |  clip_stroke_text = jm_lineart_clip_stroke_text(dev, ctx, text, stroke, ctm, scissor)\n",
      "     |  \n",
      "     |  clip_text = jm_lineart_clip_text(dev, ctx, text, ctm, scissor)\n",
      "     |  \n",
      "     |  end_group = jm_lineart_end_group(dev, ctx)\n",
      "     |  \n",
      "     |  end_layer = jm_lineart_end_layer(dev, ctx)\n",
      "     |  \n",
      "     |  fill_image = jm_increase_seqno(dev, ctx, *vargs)\n",
      "     |  \n",
      "     |  fill_image_mask = jm_increase_seqno(dev, ctx, *vargs)\n",
      "     |  \n",
      "     |  fill_path = jm_lineart_fill_path(dev, ctx, path, even_odd, ctm, colorspace, color, alpha, color_params)\n",
      "     |  \n",
      "     |  fill_shade = jm_increase_seqno(dev, ctx, *vargs)\n",
      "     |  \n",
      "     |  fill_text = jm_increase_seqno(dev, ctx, *vargs)\n",
      "     |  \n",
      "     |  ignore_text = jm_increase_seqno(dev, ctx, *vargs)\n",
      "     |  \n",
      "     |  pop_clip = jm_lineart_pop_clip(dev, ctx)\n",
      "     |  \n",
      "     |  stroke_path = jm_lineart_stroke_path(dev, ctx, path, stroke, ctm, colorspace, color, alpha, color_params)\n",
      "     |  \n",
      "     |  stroke_text = jm_increase_seqno(dev, ctx, *vargs)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from fitz.mupdf.FzDevice2:\n",
      "     |  \n",
      "     |  __disown__(self)\n",
      "     |  \n",
      "     |  __repr__ = _swig_repr(self)\n",
      "     |  \n",
      "     |  begin_mask(self, arg_0, arg_2, arg_3, arg_4, arg_5, arg_6)\n",
      "     |  \n",
      "     |  begin_metatext(self, arg_0, arg_2, arg_3)\n",
      "     |  \n",
      "     |  begin_structure(self, arg_0, arg_2, arg_3, arg_4)\n",
      "     |  \n",
      "     |  begin_tile(self, arg_0, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7)\n",
      "     |  \n",
      "     |  close_device(self, arg_0)\n",
      "     |      Default virtual method implementations; these all throw an exception.\n",
      "     |  \n",
      "     |  drop_device(self, arg_0)\n",
      "     |  \n",
      "     |  end_mask(self, arg_0, arg_2)\n",
      "     |  \n",
      "     |  end_metatext(self, arg_0)\n",
      "     |  \n",
      "     |  end_structure(self, arg_0)\n",
      "     |  \n",
      "     |  end_tile(self, arg_0)\n",
      "     |  \n",
      "     |  render_flags(self, arg_0, arg_2, arg_3)\n",
      "     |  \n",
      "     |  set_default_colorspaces(self, arg_0, arg_2)\n",
      "     |  \n",
      "     |  use_virtual_begin_group(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_begin_layer(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_begin_mask(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_begin_metatext(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_begin_structure(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_begin_tile(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_clip_image_mask(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_clip_path(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_clip_stroke_path(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_clip_stroke_text(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_clip_text(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_close_device(self, use=True)\n",
      "     |      These methods set the function pointers in *m_internal\n",
      "     |      to point to internal callbacks that call our virtual methods.\n",
      "     |  \n",
      "     |  use_virtual_drop_device(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_end_group(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_end_layer(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_end_mask(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_end_metatext(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_end_structure(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_end_tile(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_fill_image(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_fill_image_mask(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_fill_path(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_fill_shade(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_fill_text(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_ignore_text(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_pop_clip(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_render_flags(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_set_default_colorspaces(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_stroke_path(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_stroke_text(self, use=True)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods inherited from fitz.mupdf.FzDevice2:\n",
      "     |  \n",
      "     |  __swig_destroy__ = delete_FzDevice2(...)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from fitz.mupdf.FzDevice2:\n",
      "     |  \n",
      "     |  thisown\n",
      "     |      The membership flag\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from fitz.mupdf.FzDevice:\n",
      "     |  \n",
      "     |  fz_begin_group(self, area, cs, isolated, knockout, blendmode, alpha)\n",
      "     |      Class-aware wrapper for `::fz_begin_group()`.\n",
      "     |  \n",
      "     |  fz_begin_layer(self, layer_name)\n",
      "     |      Class-aware wrapper for `::fz_begin_layer()`.\n",
      "     |  \n",
      "     |  fz_begin_mask(self, area, luminosity, colorspace, bc, color_params)\n",
      "     |      Class-aware wrapper for `::fz_begin_mask()`.\n",
      "     |  \n",
      "     |  fz_begin_metatext(self, meta, text)\n",
      "     |      Class-aware wrapper for `::fz_begin_metatext()`.\n",
      "     |  \n",
      "     |  fz_begin_structure(self, standard, raw, idx)\n",
      "     |      Class-aware wrapper for `::fz_begin_structure()`.\n",
      "     |  \n",
      "     |  fz_begin_tile(self, area, view, xstep, ystep, ctm)\n",
      "     |      Class-aware wrapper for `::fz_begin_tile()`.\n",
      "     |  \n",
      "     |  fz_begin_tile_id(self, area, view, xstep, ystep, ctm, id)\n",
      "     |      Class-aware wrapper for `::fz_begin_tile_id()`.\n",
      "     |  \n",
      "     |  fz_clip_image_mask(self, image, ctm, scissor)\n",
      "     |      Class-aware wrapper for `::fz_clip_image_mask()`.\n",
      "     |  \n",
      "     |  fz_clip_path(self, path, even_odd, ctm, scissor)\n",
      "     |      Class-aware wrapper for `::fz_clip_path()`.\n",
      "     |  \n",
      "     |  fz_clip_stroke_path(self, path, stroke, ctm, scissor)\n",
      "     |      Class-aware wrapper for `::fz_clip_stroke_path()`.\n",
      "     |  \n",
      "     |  fz_clip_stroke_text(self, text, stroke, ctm, scissor)\n",
      "     |      Class-aware wrapper for `::fz_clip_stroke_text()`.\n",
      "     |  \n",
      "     |  fz_clip_text(self, text, ctm, scissor)\n",
      "     |      Class-aware wrapper for `::fz_clip_text()`.\n",
      "     |  \n",
      "     |  fz_close_device(self)\n",
      "     |      Class-aware wrapper for `::fz_close_device()`.\n",
      "     |              Signal the end of input, and flush any buffered output.\n",
      "     |              This is NOT called implicitly on fz_drop_device. This\n",
      "     |              may throw exceptions.\n",
      "     |  \n",
      "     |  fz_device_current_scissor(self)\n",
      "     |      Class-aware wrapper for `::fz_device_current_scissor()`.\n",
      "     |              Find current scissor region as tracked by the device.\n",
      "     |  \n",
      "     |  fz_disable_device_hints(self, hints)\n",
      "     |      Class-aware wrapper for `::fz_disable_device_hints()`.\n",
      "     |              Disable (clear) hint bits within the hint bitfield for a device.\n",
      "     |  \n",
      "     |  fz_enable_device_hints(self, hints)\n",
      "     |      Class-aware wrapper for `::fz_enable_device_hints()`.\n",
      "     |              Enable (set) hint bits within the hint bitfield for a device.\n",
      "     |  \n",
      "     |  fz_end_group(self)\n",
      "     |      Class-aware wrapper for `::fz_end_group()`.\n",
      "     |  \n",
      "     |  fz_end_layer(self)\n",
      "     |      Class-aware wrapper for `::fz_end_layer()`.\n",
      "     |  \n",
      "     |  fz_end_mask(self)\n",
      "     |      Class-aware wrapper for `::fz_end_mask()`.\n",
      "     |  \n",
      "     |  fz_end_mask_tr(self, fn)\n",
      "     |      Class-aware wrapper for `::fz_end_mask_tr()`.\n",
      "     |  \n",
      "     |  fz_end_metatext(self)\n",
      "     |      Class-aware wrapper for `::fz_end_metatext()`.\n",
      "     |  \n",
      "     |  fz_end_structure(self)\n",
      "     |      Class-aware wrapper for `::fz_end_structure()`.\n",
      "     |  \n",
      "     |  fz_end_tile(self)\n",
      "     |      Class-aware wrapper for `::fz_end_tile()`.\n",
      "     |  \n",
      "     |  fz_fill_image(self, image, ctm, alpha, color_params)\n",
      "     |      Class-aware wrapper for `::fz_fill_image()`.\n",
      "     |  \n",
      "     |  fz_fill_image_mask(self, image, ctm, colorspace, color, alpha, color_params)\n",
      "     |      Class-aware wrapper for `::fz_fill_image_mask()`.\n",
      "     |  \n",
      "     |  fz_fill_path(self, path, even_odd, ctm, colorspace, color, alpha, color_params)\n",
      "     |      Class-aware wrapper for `::fz_fill_path()`.\n",
      "     |              Device calls; graphics primitives and containers.\n",
      "     |  \n",
      "     |  fz_fill_shade(self, shade, ctm, alpha, color_params)\n",
      "     |      Class-aware wrapper for `::fz_fill_shade()`.\n",
      "     |  \n",
      "     |  fz_fill_text(dev, text, ctm, colorspace, color, alpha, color_params)\n",
      "     |      Python version of fz_fill_text() taking list/tuple for `color`.\n",
      "     |  \n",
      "     |  fz_ignore_text(self, text, ctm)\n",
      "     |      Class-aware wrapper for `::fz_ignore_text()`.\n",
      "     |  \n",
      "     |  fz_new_ocr_device(self, ctm, mediabox, with_list, language, datadir, progress, progress_arg)\n",
      "     |      Class-aware wrapper for `::fz_new_ocr_device()`.\n",
      "     |              Create a device to OCR the text on the page.\n",
      "     |      \n",
      "     |              Renders the page internally to a bitmap that is then OCRd. Text\n",
      "     |              is then forwarded onto the target device.\n",
      "     |      \n",
      "     |              target: The target device to receive the OCRd text.\n",
      "     |      \n",
      "     |              ctm: The transform to apply to the mediabox to get the size for\n",
      "     |              the rendered page image. Also used to calculate the resolution\n",
      "     |              for the page image. In general, this will be the same as the CTM\n",
      "     |              that you pass to fz_run_page (or fz_run_display_list) to feed\n",
      "     |              this device.\n",
      "     |      \n",
      "     |              mediabox: The mediabox (in points). Combined with the CTM to get\n",
      "     |              the bounds of the pixmap used internally for the rendered page\n",
      "     |              image.\n",
      "     |      \n",
      "     |              with_list: If with_list is false, then all non-text operations\n",
      "     |              are forwarded instantly to the target device. This results in\n",
      "     |              the target device seeing all NON-text operations, followed by\n",
      "     |              all the text operations (derived from OCR).\n",
      "     |      \n",
      "     |              If with_list is true, then all the marking operations are\n",
      "     |              collated into a display list which is then replayed to the\n",
      "     |              target device at the end.\n",
      "     |      \n",
      "     |              language: NULL (for \"eng\"), or a pointer to a string to describe\n",
      "     |              the languages/scripts that should be used for OCR (e.g.\n",
      "     |              \"eng,ara\").\n",
      "     |      \n",
      "     |              datadir: NULL (for \"\"), or a pointer to a path string otherwise\n",
      "     |              provided to Tesseract in the TESSDATA_PREFIX environment variable.\n",
      "     |      \n",
      "     |              progress: NULL, or function to be called periodically to indicate\n",
      "     |              progress. Return 0 to continue, or 1 to cancel. progress_arg is\n",
      "     |              returned as the void *. The int is a value between 0 and 100 to\n",
      "     |              indicate progress.\n",
      "     |      \n",
      "     |              progress_arg: A void * value to be parrotted back to the progress\n",
      "     |              function.\n",
      "     |  \n",
      "     |  fz_pop_clip(self)\n",
      "     |      Class-aware wrapper for `::fz_pop_clip()`.\n",
      "     |  \n",
      "     |  fz_render_flags(self, set, clear)\n",
      "     |      Class-aware wrapper for `::fz_render_flags()`.\n",
      "     |  \n",
      "     |  fz_render_t3_glyph_direct(self, font, gid, trm, gstate, def_cs)\n",
      "     |      Class-aware wrapper for `::fz_render_t3_glyph_direct()`.\n",
      "     |              Nasty PDF interpreter specific hernia, required to allow the\n",
      "     |              interpreter to replay glyphs from a type3 font directly into\n",
      "     |              the target device.\n",
      "     |      \n",
      "     |              This is only used in exceptional circumstances (such as type3\n",
      "     |              glyphs that inherit current graphics state, or nested type3\n",
      "     |              glyphs).\n",
      "     |  \n",
      "     |  fz_set_default_colorspaces(self, default_cs)\n",
      "     |      Class-aware wrapper for `::fz_set_default_colorspaces()`.\n",
      "     |  \n",
      "     |  fz_stroke_path(self, path, stroke, ctm, colorspace, color, alpha, color_params)\n",
      "     |      Class-aware wrapper for `::fz_stroke_path()`.\n",
      "     |  \n",
      "     |  fz_stroke_text(self, text, stroke, ctm, colorspace, color, alpha, color_params)\n",
      "     |      Class-aware wrapper for `::fz_stroke_text()`.\n",
      "     |  \n",
      "     |  m_internal_value(self)\n",
      "     |      Return numerical value of .m_internal; helps with Python debugging.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods inherited from fitz.mupdf.FzDevice:\n",
      "     |  \n",
      "     |  fz_new_draw_device_type3(transform, dest)\n",
      "     |      Class-aware wrapper for `::fz_new_draw_device_type3()`.\n",
      "     |  \n",
      "     |  fz_new_xmltext_device(out)\n",
      "     |      Class-aware wrapper for `::fz_new_xmltext_device()`.\n",
      "     |              Create a device to output raw information.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from fitz.mupdf.FzDevice:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  m_internal\n",
      "     |      Pointer to wrapped data.\n",
      "     |  \n",
      "     |  s_num_instances\n",
      "    \n",
      "    class JM_new_output_fileptr_Output(fitz.mupdf.FzOutput2)\n",
      "     |  JM_new_output_fileptr_Output(bio)\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      JM_new_output_fileptr_Output\n",
      "     |      fitz.mupdf.FzOutput2\n",
      "     |      fitz.mupdf.FzOutput\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, bio)\n",
      "     |      == Constructor.\n",
      "     |  \n",
      "     |  seek(self, ctx, offset, whence)\n",
      "     |  \n",
      "     |  tell(self, ctx)\n",
      "     |  \n",
      "     |  truncate(self, ctx)\n",
      "     |  \n",
      "     |  write(self, ctx, data_raw, data_length)\n",
      "     |      Default virtual method implementations; these all throw an exception.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from fitz.mupdf.FzOutput2:\n",
      "     |  \n",
      "     |  __disown__(self)\n",
      "     |  \n",
      "     |  __repr__ = _swig_repr(self)\n",
      "     |  \n",
      "     |  as_stream(self, arg_0)\n",
      "     |  \n",
      "     |  close(self, arg_0)\n",
      "     |  \n",
      "     |  drop(self, arg_0)\n",
      "     |  \n",
      "     |  use_virtual_as_stream(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_close(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_drop(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_seek(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_tell(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_truncate(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_write(self, use=True)\n",
      "     |      These methods set the function pointers in *m_internal\n",
      "     |      to point to internal callbacks that call our virtual methods.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods inherited from fitz.mupdf.FzOutput2:\n",
      "     |  \n",
      "     |  __swig_destroy__ = delete_FzOutput2(...)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from fitz.mupdf.FzOutput2:\n",
      "     |  \n",
      "     |  thisown\n",
      "     |      The membership flag\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from fitz.mupdf.FzOutput:\n",
      "     |  \n",
      "     |  fz_close_output(self)\n",
      "     |      Class-aware wrapper for `::fz_close_output()`.\n",
      "     |              Flush pending output and close an output stream.\n",
      "     |  \n",
      "     |  fz_debug_store(self)\n",
      "     |      Class-aware wrapper for `::fz_debug_store()`.\n",
      "     |              Output debugging information for the current state of the store\n",
      "     |              to the given output channel.\n",
      "     |  \n",
      "     |  fz_dump_glyph_cache_stats(self)\n",
      "     |      Class-aware wrapper for `::fz_dump_glyph_cache_stats()`.\n",
      "     |              Dump debug statistics for the glyph cache.\n",
      "     |  \n",
      "     |  fz_flush_output(self)\n",
      "     |      Class-aware wrapper for `::fz_flush_output()`.\n",
      "     |              Flush unwritten data.\n",
      "     |  \n",
      "     |  fz_new_svg_device(self, page_width, page_height, text_format, reuse_images)\n",
      "     |      Class-aware wrapper for `::fz_new_svg_device()`.\n",
      "     |              Create a device that outputs (single page) SVG files to\n",
      "     |              the given output stream.\n",
      "     |      \n",
      "     |              Equivalent to fz_new_svg_device_with_id passing id = NULL.\n",
      "     |  \n",
      "     |  fz_new_svg_device_with_id = FzOutput_fz_new_svg_device_with_id_outparams_fn(self, page_width, page_height, text_format, reuse_images)\n",
      "     |      Helper for out-params of class method fz_output::ll_fz_new_svg_device_with_id() [fz_new_svg_device_with_id()].\n",
      "     |  \n",
      "     |  fz_new_trace_device(self)\n",
      "     |      Class-aware wrapper for `::fz_new_trace_device()`.\n",
      "     |              Create a device to print a debug trace of all device calls.\n",
      "     |  \n",
      "     |  fz_new_xmltext_device(self)\n",
      "     |      Class-aware wrapper for `::fz_new_xmltext_device()`.\n",
      "     |              Create a device to output raw information.\n",
      "     |  \n",
      "     |  fz_output_supports_stream(self)\n",
      "     |      Class-aware wrapper for `::fz_output_supports_stream()`.\n",
      "     |              Query whether a given fz_output supports fz_stream_from_output.\n",
      "     |  \n",
      "     |  fz_output_xml(self, item, level)\n",
      "     |      Class-aware wrapper for `::fz_output_xml()`.\n",
      "     |              Pretty-print an XML tree to given output.\n",
      "     |  \n",
      "     |  fz_print_stext_header_as_html(self)\n",
      "     |      Class-aware wrapper for `::fz_print_stext_header_as_html()`.\n",
      "     |  \n",
      "     |  fz_print_stext_header_as_xhtml(self)\n",
      "     |      Class-aware wrapper for `::fz_print_stext_header_as_xhtml()`.\n",
      "     |  \n",
      "     |  fz_print_stext_page_as_html(self, page, id)\n",
      "     |      Class-aware wrapper for `::fz_print_stext_page_as_html()`.\n",
      "     |              Output structured text to a file in HTML (visual) format.\n",
      "     |  \n",
      "     |  fz_print_stext_page_as_json(self, page, scale)\n",
      "     |      Class-aware wrapper for `::fz_print_stext_page_as_json()`.\n",
      "     |              Output structured text to a file in JSON format.\n",
      "     |  \n",
      "     |  fz_print_stext_page_as_text(self, page)\n",
      "     |      Class-aware wrapper for `::fz_print_stext_page_as_text()`.\n",
      "     |              Output structured text to a file in plain-text UTF-8 format.\n",
      "     |  \n",
      "     |  fz_print_stext_page_as_xhtml(self, page, id)\n",
      "     |      Class-aware wrapper for `::fz_print_stext_page_as_xhtml()`.\n",
      "     |              Output structured text to a file in XHTML (semantic) format.\n",
      "     |  \n",
      "     |  fz_print_stext_page_as_xml(self, page, id)\n",
      "     |      Class-aware wrapper for `::fz_print_stext_page_as_xml()`.\n",
      "     |              Output structured text to a file in XML format.\n",
      "     |  \n",
      "     |  fz_print_stext_trailer_as_html(self)\n",
      "     |      Class-aware wrapper for `::fz_print_stext_trailer_as_html()`.\n",
      "     |  \n",
      "     |  fz_print_stext_trailer_as_xhtml(self)\n",
      "     |      Class-aware wrapper for `::fz_print_stext_trailer_as_xhtml()`.\n",
      "     |  \n",
      "     |  fz_seek_output(self, off, whence)\n",
      "     |      Class-aware wrapper for `::fz_seek_output()`.\n",
      "     |              Seek to the specified file position.\n",
      "     |              See fseek for arguments.\n",
      "     |      \n",
      "     |              Throw an error on unseekable outputs.\n",
      "     |  \n",
      "     |  fz_set_stddbg(self)\n",
      "     |      Class-aware wrapper for `::fz_set_stddbg()`.\n",
      "     |              Set the output stream to be used for fz_stddbg. Set to NULL to\n",
      "     |              reset to default (stderr).\n",
      "     |  \n",
      "     |  fz_stream_from_output(self)\n",
      "     |      Class-aware wrapper for `::fz_stream_from_output()`.\n",
      "     |              Obtain the fz_output in the form of a fz_stream.\n",
      "     |      \n",
      "     |              This allows data to be read back from some forms of fz_output\n",
      "     |              object. When finished reading, the fz_stream should be released\n",
      "     |              by calling fz_drop_stream. Until the fz_stream is dropped, no\n",
      "     |              further operations should be performed on the fz_output object.\n",
      "     |  \n",
      "     |  fz_tell_output(self)\n",
      "     |      Class-aware wrapper for `::fz_tell_output()`.\n",
      "     |              Return the current file position.\n",
      "     |      \n",
      "     |              Throw an error on untellable outputs.\n",
      "     |  \n",
      "     |  fz_truncate_output(self)\n",
      "     |      Class-aware wrapper for `::fz_truncate_output()`.\n",
      "     |              Truncate the output at the current position.\n",
      "     |      \n",
      "     |              This allows output streams which have seeked back from the end\n",
      "     |              of their storage to be truncated at the current point.\n",
      "     |  \n",
      "     |  fz_write_base64(self, data, size, newline)\n",
      "     |      Class-aware wrapper for `::fz_write_base64()`.\n",
      "     |              Write a base64 encoded data block, optionally with periodic\n",
      "     |              newlines.\n",
      "     |  \n",
      "     |  fz_write_base64_buffer(self, data, newline)\n",
      "     |      Class-aware wrapper for `::fz_write_base64_buffer()`.\n",
      "     |              Write a base64 encoded fz_buffer, optionally with periodic\n",
      "     |              newlines.\n",
      "     |  \n",
      "     |  fz_write_bitmap_as_pbm(self, bitmap)\n",
      "     |      Class-aware wrapper for `::fz_write_bitmap_as_pbm()`.\n",
      "     |              Write a bitmap as a pbm.\n",
      "     |  \n",
      "     |  fz_write_bitmap_as_pcl(self, bitmap, pcl)\n",
      "     |      Class-aware wrapper for `::fz_write_bitmap_as_pcl()`.\n",
      "     |              Write a bitmap as mono PCL.\n",
      "     |  \n",
      "     |  fz_write_bitmap_as_pkm(self, bitmap)\n",
      "     |      Class-aware wrapper for `::fz_write_bitmap_as_pkm()`.\n",
      "     |              Write a CMYK bitmap as a pkm.\n",
      "     |  \n",
      "     |  fz_write_bitmap_as_pwg(self, bitmap, pwg)\n",
      "     |      Class-aware wrapper for `::fz_write_bitmap_as_pwg()`.\n",
      "     |              Write a bitmap as a PWG.\n",
      "     |  \n",
      "     |  fz_write_bitmap_as_pwg_page(self, bitmap, pwg)\n",
      "     |      Class-aware wrapper for `::fz_write_bitmap_as_pwg_page()`.\n",
      "     |              Write a bitmap as a PWG page.\n",
      "     |      \n",
      "     |              Caller should provide a file header by calling\n",
      "     |              fz_write_pwg_file_header, but can then write several pages to\n",
      "     |              the same file.\n",
      "     |  \n",
      "     |  fz_write_bits(self, data, num_bits)\n",
      "     |      Class-aware wrapper for `::fz_write_bits()`.\n",
      "     |              Write num_bits of data to the end of the output stream, assumed to be packed\n",
      "     |              most significant bits first.\n",
      "     |  \n",
      "     |  fz_write_bits_sync(self)\n",
      "     |      Class-aware wrapper for `::fz_write_bits_sync()`.\n",
      "     |              Sync to byte boundary after writing bits.\n",
      "     |  \n",
      "     |  fz_write_buffer(self, data)\n",
      "     |      Class-aware wrapper for `::fz_write_buffer()`.\n",
      "     |  \n",
      "     |  fz_write_byte(self, x)\n",
      "     |      Class-aware wrapper for `::fz_write_byte()`.\n",
      "     |  \n",
      "     |  fz_write_char(self, x)\n",
      "     |      Class-aware wrapper for `::fz_write_char()`.\n",
      "     |  \n",
      "     |  fz_write_data(self, data, size)\n",
      "     |      Class-aware wrapper for `::fz_write_data()`.\n",
      "     |              Write data to output.\n",
      "     |      \n",
      "     |              data: Pointer to data to write.\n",
      "     |              size: Size of data to write in bytes.\n",
      "     |  \n",
      "     |  fz_write_float_be(self, f)\n",
      "     |      Class-aware wrapper for `::fz_write_float_be()`.\n",
      "     |  \n",
      "     |  fz_write_float_le(self, f)\n",
      "     |      Class-aware wrapper for `::fz_write_float_le()`.\n",
      "     |  \n",
      "     |  fz_write_image_as_data_uri(self, image)\n",
      "     |      Class-aware wrapper for `::fz_write_image_as_data_uri()`.\n",
      "     |              Write image as a data URI (for HTML and SVG output).\n",
      "     |  \n",
      "     |  fz_write_int16_be(self, x)\n",
      "     |      Class-aware wrapper for `::fz_write_int16_be()`.\n",
      "     |  \n",
      "     |  fz_write_int16_le(self, x)\n",
      "     |      Class-aware wrapper for `::fz_write_int16_le()`.\n",
      "     |  \n",
      "     |  fz_write_int32_be(self, x)\n",
      "     |      Class-aware wrapper for `::fz_write_int32_be()`.\n",
      "     |              Write different sized data to an output stream.\n",
      "     |  \n",
      "     |  fz_write_int32_le(self, x)\n",
      "     |      Class-aware wrapper for `::fz_write_int32_le()`.\n",
      "     |  \n",
      "     |  fz_write_pixmap_as_data_uri(self, pixmap)\n",
      "     |      Class-aware wrapper for `::fz_write_pixmap_as_data_uri()`.\n",
      "     |  \n",
      "     |  fz_write_pixmap_as_jpeg(self, pix, quality, invert_cmyk)\n",
      "     |      Class-aware wrapper for `::fz_write_pixmap_as_jpeg()`.\n",
      "     |              Write a pixmap as a JPEG.\n",
      "     |  \n",
      "     |  fz_write_pixmap_as_jpx(self, pix, quality)\n",
      "     |      Class-aware wrapper for `::fz_write_pixmap_as_jpx()`.\n",
      "     |              Pixmap data as JP2K with no subsampling.\n",
      "     |      \n",
      "     |              quality = 100 = lossless\n",
      "     |              otherwise for a factor of x compression use 100-x. (so 80 is 1:20 compression)\n",
      "     |  \n",
      "     |  fz_write_pixmap_as_pam(self, pixmap)\n",
      "     |      Class-aware wrapper for `::fz_write_pixmap_as_pam()`.\n",
      "     |              Write a pixmap as a pnm (greyscale, rgb or cmyk, with or without\n",
      "     |              alpha).\n",
      "     |  \n",
      "     |  fz_write_pixmap_as_pcl(self, pixmap, pcl)\n",
      "     |      Class-aware wrapper for `::fz_write_pixmap_as_pcl()`.\n",
      "     |              Write an (RGB) pixmap as color PCL.\n",
      "     |  \n",
      "     |  fz_write_pixmap_as_pclm(self, pixmap, options)\n",
      "     |      Class-aware wrapper for `::fz_write_pixmap_as_pclm()`.\n",
      "     |              Write a (Greyscale or RGB) pixmap as pclm.\n",
      "     |  \n",
      "     |  fz_write_pixmap_as_pdfocr(self, pixmap, options)\n",
      "     |      Class-aware wrapper for `::fz_write_pixmap_as_pdfocr()`.\n",
      "     |              Write a (Greyscale or RGB) pixmap as pdfocr.\n",
      "     |  \n",
      "     |  fz_write_pixmap_as_png(self, pixmap)\n",
      "     |      Class-aware wrapper for `::fz_write_pixmap_as_png()`.\n",
      "     |              Write a (Greyscale or RGB) pixmap as a png.\n",
      "     |  \n",
      "     |  fz_write_pixmap_as_pnm(self, pixmap)\n",
      "     |      Class-aware wrapper for `::fz_write_pixmap_as_pnm()`.\n",
      "     |              Write a pixmap as a pnm (greyscale or rgb, no alpha).\n",
      "     |  \n",
      "     |  fz_write_pixmap_as_ps(self, pixmap)\n",
      "     |      Class-aware wrapper for `::fz_write_pixmap_as_ps()`.\n",
      "     |              Write a (gray, rgb, or cmyk, no alpha) pixmap out as postscript.\n",
      "     |  \n",
      "     |  fz_write_pixmap_as_psd(self, pixmap)\n",
      "     |      Class-aware wrapper for `::fz_write_pixmap_as_psd()`.\n",
      "     |              Write a pixmap as a PSD file.\n",
      "     |  \n",
      "     |  fz_write_pixmap_as_pwg(self, pixmap, pwg)\n",
      "     |      Class-aware wrapper for `::fz_write_pixmap_as_pwg()`.\n",
      "     |              Write a pixmap as a PWG.\n",
      "     |  \n",
      "     |  fz_write_pixmap_as_pwg_page(self, pixmap, pwg)\n",
      "     |      Class-aware wrapper for `::fz_write_pixmap_as_pwg_page()`.\n",
      "     |              Write a pixmap as a PWG page.\n",
      "     |      \n",
      "     |              Caller should provide a file header by calling\n",
      "     |              fz_write_pwg_file_header, but can then write several pages to\n",
      "     |              the same file.\n",
      "     |  \n",
      "     |  fz_write_ps_file_header(self)\n",
      "     |      Class-aware wrapper for `::fz_write_ps_file_header()`.\n",
      "     |              Write the file level header for ps band writer output.\n",
      "     |  \n",
      "     |  fz_write_ps_file_trailer(self, pages)\n",
      "     |      Class-aware wrapper for `::fz_write_ps_file_trailer()`.\n",
      "     |              Write the file level trailer for ps band writer output.\n",
      "     |  \n",
      "     |  fz_write_pwg_file_header(self)\n",
      "     |      Class-aware wrapper for `::fz_write_pwg_file_header()`.\n",
      "     |              Output the file header to a pwg stream, ready for pages to follow it.\n",
      "     |  \n",
      "     |  fz_write_rune(self, rune)\n",
      "     |      Class-aware wrapper for `::fz_write_rune()`.\n",
      "     |              Write a UTF-8 encoded unicode character.\n",
      "     |  \n",
      "     |  fz_write_string(self, s)\n",
      "     |      Class-aware wrapper for `::fz_write_string()`.\n",
      "     |              Write a string. Does not write zero terminator.\n",
      "     |  \n",
      "     |  fz_write_uint16_be(self, x)\n",
      "     |      Class-aware wrapper for `::fz_write_uint16_be()`.\n",
      "     |  \n",
      "     |  fz_write_uint16_le(self, x)\n",
      "     |      Class-aware wrapper for `::fz_write_uint16_le()`.\n",
      "     |  \n",
      "     |  fz_write_uint32_be(self, x)\n",
      "     |      Class-aware wrapper for `::fz_write_uint32_be()`.\n",
      "     |  \n",
      "     |  fz_write_uint32_le(self, x)\n",
      "     |      Class-aware wrapper for `::fz_write_uint32_le()`.\n",
      "     |  \n",
      "     |  m_internal_value(self)\n",
      "     |      Return numerical value of .m_internal; helps with Python debugging.\n",
      "     |  \n",
      "     |  pdf_new_output_processor(self, ahxencode, newlines)\n",
      "     |      Class-aware wrapper for `::pdf_new_output_processor()`.\n",
      "     |  \n",
      "     |  pdf_print_crypt(self, crypt)\n",
      "     |      Class-aware wrapper for `::pdf_print_crypt()`.\n",
      "     |  \n",
      "     |  pdf_print_encrypted_obj = FzOutput_pdf_print_encrypted_obj_outparams_fn(self, obj, tight, ascii, crypt, num, gen)\n",
      "     |      Helper for out-params of class method fz_output::ll_pdf_print_encrypted_obj() [pdf_print_encrypted_obj()].\n",
      "     |  \n",
      "     |  pdf_print_font(self, fontdesc)\n",
      "     |      Class-aware wrapper for `::pdf_print_font()`.\n",
      "     |  \n",
      "     |  pdf_print_obj(self, obj, tight, ascii)\n",
      "     |      Class-aware wrapper for `::pdf_print_obj()`.\n",
      "     |  \n",
      "     |  pdf_write_digest(self, byte_range, field, digest_offset, digest_length, signer)\n",
      "     |      Class-aware wrapper for `::pdf_write_digest()`.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from fitz.mupdf.FzOutput:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  m_internal\n",
      "     |      Pointer to wrapped data.\n",
      "     |  \n",
      "     |  s_num_instances\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes inherited from fitz.mupdf.FzOutput:\n",
      "     |  \n",
      "     |  Filter_85 = 1\n",
      "     |  \n",
      "     |  Filter_HEX = 0\n",
      "     |  \n",
      "     |  Filter_RLE = 2\n",
      "     |  \n",
      "     |  Fixed_STDERR = 2\n",
      "     |  \n",
      "     |  Fixed_STDOUT = 1\n",
      "    \n",
      "    class JM_new_texttrace_device(fitz.mupdf.FzDevice2)\n",
      "     |  JM_new_texttrace_device(out)\n",
      "     |  \n",
      "     |  Trace TEXT device for Python method Page.get_texttrace()\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      JM_new_texttrace_device\n",
      "     |      fitz.mupdf.FzDevice2\n",
      "     |      fitz.mupdf.FzDevice\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, out)\n",
      "     |      == Constructor.\n",
      "     |  \n",
      "     |  begin_layer = jm_lineart_begin_layer(dev, ctx, name)\n",
      "     |  \n",
      "     |  end_layer = jm_lineart_end_layer(dev, ctx)\n",
      "     |  \n",
      "     |  fill_image = jm_increase_seqno(dev, ctx, *vargs)\n",
      "     |  \n",
      "     |  fill_image_mask = jm_increase_seqno(dev, ctx, *vargs)\n",
      "     |  \n",
      "     |  fill_path = jm_increase_seqno(dev, ctx, *vargs)\n",
      "     |  \n",
      "     |  fill_shade = jm_increase_seqno(dev, ctx, *vargs)\n",
      "     |  \n",
      "     |  fill_text = jm_lineart_fill_text(dev, ctx, text, ctm, colorspace, color, alpha, color_params)\n",
      "     |  \n",
      "     |  ignore_text = jm_lineart_ignore_text(dev, text, ctm)\n",
      "     |  \n",
      "     |  stroke_path = jm_dev_linewidth(dev, ctx, path, stroke, matrix, colorspace, color, alpha, color_params)\n",
      "     |  \n",
      "     |  stroke_text = jm_lineart_stroke_text(dev, ctx, text, stroke, ctm, colorspace, color, alpha, color_params)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from fitz.mupdf.FzDevice2:\n",
      "     |  \n",
      "     |  __disown__(self)\n",
      "     |  \n",
      "     |  __repr__ = _swig_repr(self)\n",
      "     |  \n",
      "     |  begin_group(self, arg_0, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7)\n",
      "     |  \n",
      "     |  begin_mask(self, arg_0, arg_2, arg_3, arg_4, arg_5, arg_6)\n",
      "     |  \n",
      "     |  begin_metatext(self, arg_0, arg_2, arg_3)\n",
      "     |  \n",
      "     |  begin_structure(self, arg_0, arg_2, arg_3, arg_4)\n",
      "     |  \n",
      "     |  begin_tile(self, arg_0, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7)\n",
      "     |  \n",
      "     |  clip_image_mask(self, arg_0, arg_2, arg_3, arg_4)\n",
      "     |  \n",
      "     |  clip_path(self, arg_0, arg_2, arg_3, arg_4, arg_5)\n",
      "     |  \n",
      "     |  clip_stroke_path(self, arg_0, arg_2, arg_3, arg_4, arg_5)\n",
      "     |  \n",
      "     |  clip_stroke_text(self, arg_0, arg_2, arg_3, arg_4, arg_5)\n",
      "     |  \n",
      "     |  clip_text(self, arg_0, arg_2, arg_3, arg_4)\n",
      "     |  \n",
      "     |  close_device(self, arg_0)\n",
      "     |      Default virtual method implementations; these all throw an exception.\n",
      "     |  \n",
      "     |  drop_device(self, arg_0)\n",
      "     |  \n",
      "     |  end_group(self, arg_0)\n",
      "     |  \n",
      "     |  end_mask(self, arg_0, arg_2)\n",
      "     |  \n",
      "     |  end_metatext(self, arg_0)\n",
      "     |  \n",
      "     |  end_structure(self, arg_0)\n",
      "     |  \n",
      "     |  end_tile(self, arg_0)\n",
      "     |  \n",
      "     |  pop_clip(self, arg_0)\n",
      "     |  \n",
      "     |  render_flags(self, arg_0, arg_2, arg_3)\n",
      "     |  \n",
      "     |  set_default_colorspaces(self, arg_0, arg_2)\n",
      "     |  \n",
      "     |  use_virtual_begin_group(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_begin_layer(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_begin_mask(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_begin_metatext(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_begin_structure(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_begin_tile(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_clip_image_mask(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_clip_path(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_clip_stroke_path(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_clip_stroke_text(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_clip_text(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_close_device(self, use=True)\n",
      "     |      These methods set the function pointers in *m_internal\n",
      "     |      to point to internal callbacks that call our virtual methods.\n",
      "     |  \n",
      "     |  use_virtual_drop_device(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_end_group(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_end_layer(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_end_mask(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_end_metatext(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_end_structure(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_end_tile(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_fill_image(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_fill_image_mask(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_fill_path(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_fill_shade(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_fill_text(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_ignore_text(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_pop_clip(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_render_flags(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_set_default_colorspaces(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_stroke_path(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_stroke_text(self, use=True)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods inherited from fitz.mupdf.FzDevice2:\n",
      "     |  \n",
      "     |  __swig_destroy__ = delete_FzDevice2(...)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from fitz.mupdf.FzDevice2:\n",
      "     |  \n",
      "     |  thisown\n",
      "     |      The membership flag\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from fitz.mupdf.FzDevice:\n",
      "     |  \n",
      "     |  fz_begin_group(self, area, cs, isolated, knockout, blendmode, alpha)\n",
      "     |      Class-aware wrapper for `::fz_begin_group()`.\n",
      "     |  \n",
      "     |  fz_begin_layer(self, layer_name)\n",
      "     |      Class-aware wrapper for `::fz_begin_layer()`.\n",
      "     |  \n",
      "     |  fz_begin_mask(self, area, luminosity, colorspace, bc, color_params)\n",
      "     |      Class-aware wrapper for `::fz_begin_mask()`.\n",
      "     |  \n",
      "     |  fz_begin_metatext(self, meta, text)\n",
      "     |      Class-aware wrapper for `::fz_begin_metatext()`.\n",
      "     |  \n",
      "     |  fz_begin_structure(self, standard, raw, idx)\n",
      "     |      Class-aware wrapper for `::fz_begin_structure()`.\n",
      "     |  \n",
      "     |  fz_begin_tile(self, area, view, xstep, ystep, ctm)\n",
      "     |      Class-aware wrapper for `::fz_begin_tile()`.\n",
      "     |  \n",
      "     |  fz_begin_tile_id(self, area, view, xstep, ystep, ctm, id)\n",
      "     |      Class-aware wrapper for `::fz_begin_tile_id()`.\n",
      "     |  \n",
      "     |  fz_clip_image_mask(self, image, ctm, scissor)\n",
      "     |      Class-aware wrapper for `::fz_clip_image_mask()`.\n",
      "     |  \n",
      "     |  fz_clip_path(self, path, even_odd, ctm, scissor)\n",
      "     |      Class-aware wrapper for `::fz_clip_path()`.\n",
      "     |  \n",
      "     |  fz_clip_stroke_path(self, path, stroke, ctm, scissor)\n",
      "     |      Class-aware wrapper for `::fz_clip_stroke_path()`.\n",
      "     |  \n",
      "     |  fz_clip_stroke_text(self, text, stroke, ctm, scissor)\n",
      "     |      Class-aware wrapper for `::fz_clip_stroke_text()`.\n",
      "     |  \n",
      "     |  fz_clip_text(self, text, ctm, scissor)\n",
      "     |      Class-aware wrapper for `::fz_clip_text()`.\n",
      "     |  \n",
      "     |  fz_close_device(self)\n",
      "     |      Class-aware wrapper for `::fz_close_device()`.\n",
      "     |              Signal the end of input, and flush any buffered output.\n",
      "     |              This is NOT called implicitly on fz_drop_device. This\n",
      "     |              may throw exceptions.\n",
      "     |  \n",
      "     |  fz_device_current_scissor(self)\n",
      "     |      Class-aware wrapper for `::fz_device_current_scissor()`.\n",
      "     |              Find current scissor region as tracked by the device.\n",
      "     |  \n",
      "     |  fz_disable_device_hints(self, hints)\n",
      "     |      Class-aware wrapper for `::fz_disable_device_hints()`.\n",
      "     |              Disable (clear) hint bits within the hint bitfield for a device.\n",
      "     |  \n",
      "     |  fz_enable_device_hints(self, hints)\n",
      "     |      Class-aware wrapper for `::fz_enable_device_hints()`.\n",
      "     |              Enable (set) hint bits within the hint bitfield for a device.\n",
      "     |  \n",
      "     |  fz_end_group(self)\n",
      "     |      Class-aware wrapper for `::fz_end_group()`.\n",
      "     |  \n",
      "     |  fz_end_layer(self)\n",
      "     |      Class-aware wrapper for `::fz_end_layer()`.\n",
      "     |  \n",
      "     |  fz_end_mask(self)\n",
      "     |      Class-aware wrapper for `::fz_end_mask()`.\n",
      "     |  \n",
      "     |  fz_end_mask_tr(self, fn)\n",
      "     |      Class-aware wrapper for `::fz_end_mask_tr()`.\n",
      "     |  \n",
      "     |  fz_end_metatext(self)\n",
      "     |      Class-aware wrapper for `::fz_end_metatext()`.\n",
      "     |  \n",
      "     |  fz_end_structure(self)\n",
      "     |      Class-aware wrapper for `::fz_end_structure()`.\n",
      "     |  \n",
      "     |  fz_end_tile(self)\n",
      "     |      Class-aware wrapper for `::fz_end_tile()`.\n",
      "     |  \n",
      "     |  fz_fill_image(self, image, ctm, alpha, color_params)\n",
      "     |      Class-aware wrapper for `::fz_fill_image()`.\n",
      "     |  \n",
      "     |  fz_fill_image_mask(self, image, ctm, colorspace, color, alpha, color_params)\n",
      "     |      Class-aware wrapper for `::fz_fill_image_mask()`.\n",
      "     |  \n",
      "     |  fz_fill_path(self, path, even_odd, ctm, colorspace, color, alpha, color_params)\n",
      "     |      Class-aware wrapper for `::fz_fill_path()`.\n",
      "     |              Device calls; graphics primitives and containers.\n",
      "     |  \n",
      "     |  fz_fill_shade(self, shade, ctm, alpha, color_params)\n",
      "     |      Class-aware wrapper for `::fz_fill_shade()`.\n",
      "     |  \n",
      "     |  fz_fill_text(dev, text, ctm, colorspace, color, alpha, color_params)\n",
      "     |      Python version of fz_fill_text() taking list/tuple for `color`.\n",
      "     |  \n",
      "     |  fz_ignore_text(self, text, ctm)\n",
      "     |      Class-aware wrapper for `::fz_ignore_text()`.\n",
      "     |  \n",
      "     |  fz_new_ocr_device(self, ctm, mediabox, with_list, language, datadir, progress, progress_arg)\n",
      "     |      Class-aware wrapper for `::fz_new_ocr_device()`.\n",
      "     |              Create a device to OCR the text on the page.\n",
      "     |      \n",
      "     |              Renders the page internally to a bitmap that is then OCRd. Text\n",
      "     |              is then forwarded onto the target device.\n",
      "     |      \n",
      "     |              target: The target device to receive the OCRd text.\n",
      "     |      \n",
      "     |              ctm: The transform to apply to the mediabox to get the size for\n",
      "     |              the rendered page image. Also used to calculate the resolution\n",
      "     |              for the page image. In general, this will be the same as the CTM\n",
      "     |              that you pass to fz_run_page (or fz_run_display_list) to feed\n",
      "     |              this device.\n",
      "     |      \n",
      "     |              mediabox: The mediabox (in points). Combined with the CTM to get\n",
      "     |              the bounds of the pixmap used internally for the rendered page\n",
      "     |              image.\n",
      "     |      \n",
      "     |              with_list: If with_list is false, then all non-text operations\n",
      "     |              are forwarded instantly to the target device. This results in\n",
      "     |              the target device seeing all NON-text operations, followed by\n",
      "     |              all the text operations (derived from OCR).\n",
      "     |      \n",
      "     |              If with_list is true, then all the marking operations are\n",
      "     |              collated into a display list which is then replayed to the\n",
      "     |              target device at the end.\n",
      "     |      \n",
      "     |              language: NULL (for \"eng\"), or a pointer to a string to describe\n",
      "     |              the languages/scripts that should be used for OCR (e.g.\n",
      "     |              \"eng,ara\").\n",
      "     |      \n",
      "     |              datadir: NULL (for \"\"), or a pointer to a path string otherwise\n",
      "     |              provided to Tesseract in the TESSDATA_PREFIX environment variable.\n",
      "     |      \n",
      "     |              progress: NULL, or function to be called periodically to indicate\n",
      "     |              progress. Return 0 to continue, or 1 to cancel. progress_arg is\n",
      "     |              returned as the void *. The int is a value between 0 and 100 to\n",
      "     |              indicate progress.\n",
      "     |      \n",
      "     |              progress_arg: A void * value to be parrotted back to the progress\n",
      "     |              function.\n",
      "     |  \n",
      "     |  fz_pop_clip(self)\n",
      "     |      Class-aware wrapper for `::fz_pop_clip()`.\n",
      "     |  \n",
      "     |  fz_render_flags(self, set, clear)\n",
      "     |      Class-aware wrapper for `::fz_render_flags()`.\n",
      "     |  \n",
      "     |  fz_render_t3_glyph_direct(self, font, gid, trm, gstate, def_cs)\n",
      "     |      Class-aware wrapper for `::fz_render_t3_glyph_direct()`.\n",
      "     |              Nasty PDF interpreter specific hernia, required to allow the\n",
      "     |              interpreter to replay glyphs from a type3 font directly into\n",
      "     |              the target device.\n",
      "     |      \n",
      "     |              This is only used in exceptional circumstances (such as type3\n",
      "     |              glyphs that inherit current graphics state, or nested type3\n",
      "     |              glyphs).\n",
      "     |  \n",
      "     |  fz_set_default_colorspaces(self, default_cs)\n",
      "     |      Class-aware wrapper for `::fz_set_default_colorspaces()`.\n",
      "     |  \n",
      "     |  fz_stroke_path(self, path, stroke, ctm, colorspace, color, alpha, color_params)\n",
      "     |      Class-aware wrapper for `::fz_stroke_path()`.\n",
      "     |  \n",
      "     |  fz_stroke_text(self, text, stroke, ctm, colorspace, color, alpha, color_params)\n",
      "     |      Class-aware wrapper for `::fz_stroke_text()`.\n",
      "     |  \n",
      "     |  m_internal_value(self)\n",
      "     |      Return numerical value of .m_internal; helps with Python debugging.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods inherited from fitz.mupdf.FzDevice:\n",
      "     |  \n",
      "     |  fz_new_draw_device_type3(transform, dest)\n",
      "     |      Class-aware wrapper for `::fz_new_draw_device_type3()`.\n",
      "     |  \n",
      "     |  fz_new_xmltext_device(out)\n",
      "     |      Class-aware wrapper for `::fz_new_xmltext_device()`.\n",
      "     |              Create a device to output raw information.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from fitz.mupdf.FzDevice:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  m_internal\n",
      "     |      Pointer to wrapped data.\n",
      "     |  \n",
      "     |  s_num_instances\n",
      "    \n",
      "    class Link(builtins.object)\n",
      "     |  Link(this)\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __del__(self)\n",
      "     |  \n",
      "     |  __init__(self, this)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  __repr__(self)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __str__(self)\n",
      "     |      Return str(self).\n",
      "     |  \n",
      "     |  set_border(self, border=None, width=0, dashes=None, style=None)\n",
      "     |  \n",
      "     |  set_colors(self, colors=None, stroke=None, fill=None)\n",
      "     |      Set border colors.\n",
      "     |  \n",
      "     |  set_flags(self, flags)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties defined here:\n",
      "     |  \n",
      "     |  border\n",
      "     |  \n",
      "     |  colors\n",
      "     |  \n",
      "     |  dest\n",
      "     |      Create link destination details.\n",
      "     |  \n",
      "     |  flags\n",
      "     |  \n",
      "     |  is_external\n",
      "     |      Flag the link as external.\n",
      "     |  \n",
      "     |  next\n",
      "     |      Next link.\n",
      "     |  \n",
      "     |  rect\n",
      "     |      Rectangle ('hot area').\n",
      "     |  \n",
      "     |  uri\n",
      "     |      Uri string.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  page = -1\n",
      "    \n",
      "    class Matrix(builtins.object)\n",
      "     |  Matrix(*args, a=None, b=None, c=None, d=None, e=None, f=None)\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __abs__(self)\n",
      "     |  \n",
      "     |  __add__(self, m)\n",
      "     |  \n",
      "     |  __bool__(self)\n",
      "     |  \n",
      "     |  __div__ = __truediv__(self, m)\n",
      "     |  \n",
      "     |  __eq__(self, mat)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __getitem__(self, i)\n",
      "     |  \n",
      "     |  __init__(self, *args, a=None, b=None, c=None, d=None, e=None, f=None)\n",
      "     |      Matrix() - all zeros\n",
      "     |      Matrix(a, b, c, d, e, f)\n",
      "     |      Matrix(zoom-x, zoom-y) - zoom\n",
      "     |      Matrix(shear-x, shear-y, 1) - shear\n",
      "     |      Matrix(degree) - rotate\n",
      "     |      Matrix(Matrix) - new copy\n",
      "     |      Matrix(sequence) - from 'sequence'\n",
      "     |      Matrix(mupdf.FzMatrix) - from MuPDF class wrapper for fz_matrix.\n",
      "     |      \n",
      "     |      Explicit keyword args a, b, c, d, e, f override any earlier settings if\n",
      "     |      not None.\n",
      "     |  \n",
      "     |  __inv__ = __invert__(self)\n",
      "     |  \n",
      "     |  __invert__(self)\n",
      "     |      Calculate inverted matrix.\n",
      "     |  \n",
      "     |  __len__(self)\n",
      "     |  \n",
      "     |  __mul__(self, m)\n",
      "     |  \n",
      "     |  __neg__(self)\n",
      "     |  \n",
      "     |  __nonzero__(self)\n",
      "     |  \n",
      "     |  __pos__(self)\n",
      "     |  \n",
      "     |  __repr__(self)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __setitem__(self, i, v)\n",
      "     |  \n",
      "     |  __sub__(self, m)\n",
      "     |  \n",
      "     |  __truediv__(self, m)\n",
      "     |  \n",
      "     |  concat(self, one, two)\n",
      "     |      Multiply two matrices and replace current one.\n",
      "     |  \n",
      "     |  invert(self, src=None)\n",
      "     |      Calculate the inverted matrix. Return 0 if successful and replace\n",
      "     |      current one. Else return 1 and do nothing.\n",
      "     |  \n",
      "     |  norm = __abs__(self)\n",
      "     |  \n",
      "     |  prerotate(self, theta)\n",
      "     |      Calculate pre rotation and replace current matrix.\n",
      "     |  \n",
      "     |  prescale(self, sx, sy)\n",
      "     |      Calculate pre scaling and replace current matrix.\n",
      "     |  \n",
      "     |  preshear(self, h, v)\n",
      "     |      Calculate pre shearing and replace current matrix.\n",
      "     |  \n",
      "     |  pretranslate(self, tx, ty)\n",
      "     |      Calculate pre translation and replace current matrix.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties defined here:\n",
      "     |  \n",
      "     |  is_rectilinear\n",
      "     |      True if rectangles are mapped to rectangles.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  __hash__ = None\n",
      "    \n",
      "    class Outline(builtins.object)\n",
      "     |  Outline(ol)\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, ol)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  destination(self, document)\n",
      "     |      Like `dest` property but uses `document` to resolve destinations for\n",
      "     |      kind=LINK_NAMED.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties defined here:\n",
      "     |  \n",
      "     |  dest\n",
      "     |      outline destination details\n",
      "     |  \n",
      "     |  down\n",
      "     |  \n",
      "     |  is_external\n",
      "     |  \n",
      "     |  is_open\n",
      "     |  \n",
      "     |  next\n",
      "     |  \n",
      "     |  page\n",
      "     |  \n",
      "     |  title\n",
      "     |  \n",
      "     |  uri\n",
      "     |  \n",
      "     |  x\n",
      "     |  \n",
      "     |  y\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  this\n",
      "    \n",
      "    class Page(builtins.object)\n",
      "     |  Page(page, document)\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, page, document)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  __repr__(self)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __str__(self)\n",
      "     |      Return str(self).\n",
      "     |  \n",
      "     |  add_caret_annot(self, point: 'point_like') -> fitz.Annot\n",
      "     |      Add a 'Caret' annotation.\n",
      "     |  \n",
      "     |  add_circle_annot(self, rect: 'rect_like') -> fitz.Annot\n",
      "     |      Add a 'Circle' (ellipse, oval) annotation.\n",
      "     |  \n",
      "     |  add_file_annot(self, point: 'point_like', buffer_: ByteString, filename: str, ufilename: Optional[str] = None, desc: Optional[str] = None, icon: Optional[str] = None) -> fitz.Annot\n",
      "     |      Add a 'FileAttachment' annotation.\n",
      "     |  \n",
      "     |  add_freetext_annot(self, rect: 'rect_like', text: str, fontsize: float = 11, fontname: Optional[str] = None, border_color: Optional[Sequence] = None, text_color: Optional[Sequence] = None, fill_color: Optional[Sequence] = None, align: int = 0, rotate: int = 0) -> fitz.Annot\n",
      "     |      Add a 'FreeText' annotation.\n",
      "     |  \n",
      "     |  add_highlight_annot(self, quads=None, start=None, stop=None, clip=None) -> fitz.Annot\n",
      "     |      Add a 'Highlight' annotation.\n",
      "     |  \n",
      "     |  add_ink_annot(self, handwriting: list) -> fitz.Annot\n",
      "     |      Add a 'Ink' ('handwriting') annotation.\n",
      "     |      \n",
      "     |      The argument must be a list of lists of point_likes.\n",
      "     |  \n",
      "     |  add_line_annot(self, p1: 'point_like', p2: 'point_like') -> fitz.Annot\n",
      "     |      Add a 'Line' annotation.\n",
      "     |  \n",
      "     |  add_polygon_annot(self, points: list) -> fitz.Annot\n",
      "     |      Add a 'Polygon' annotation.\n",
      "     |  \n",
      "     |  add_polyline_annot(self, points: list) -> fitz.Annot\n",
      "     |      Add a 'PolyLine' annotation.\n",
      "     |  \n",
      "     |  add_rect_annot(self, rect: 'rect_like') -> fitz.Annot\n",
      "     |      Add a 'Square' (rectangle) annotation.\n",
      "     |  \n",
      "     |  add_redact_annot(self, quad, text: Optional[str] = None, fontname: Optional[str] = None, fontsize: float = 11, align: int = 0, fill: Optional[Sequence] = None, text_color: Optional[Sequence] = None, cross_out: bool = True) -> fitz.Annot\n",
      "     |      Add a 'Redact' annotation.\n",
      "     |  \n",
      "     |  add_squiggly_annot(self, quads=None, start=None, stop=None, clip=None) -> fitz.Annot\n",
      "     |      Add a 'Squiggly' annotation.\n",
      "     |  \n",
      "     |  add_stamp_annot(self, rect: 'rect_like', stamp: int = 0) -> fitz.Annot\n",
      "     |      Add a ('rubber') 'Stamp' annotation.\n",
      "     |  \n",
      "     |  add_strikeout_annot(self, quads=None, start=None, stop=None, clip=None) -> fitz.Annot\n",
      "     |      Add a 'StrikeOut' annotation.\n",
      "     |  \n",
      "     |  add_text_annot(self, point: 'point_like', text: str, icon: str = 'Note') -> fitz.Annot\n",
      "     |      Add a 'Text' (sticky note) annotation.\n",
      "     |  \n",
      "     |  add_underline_annot(self, quads=None, start=None, stop=None, clip=None) -> fitz.Annot\n",
      "     |      Add a 'Underline' annotation.\n",
      "     |  \n",
      "     |  add_widget(self, widget: fitz.Widget) -> fitz.Annot\n",
      "     |      Add a 'Widget' (form field).\n",
      "     |  \n",
      "     |  annot_names(self)\n",
      "     |      page get list of annot names\n",
      "     |  \n",
      "     |  annot_xrefs = JM_get_annot_xref_list2(*args)\n",
      "     |  \n",
      "     |  annots(self, types=None)\n",
      "     |      Generator over the annotations of a page.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          types: (list) annotation types to subselect from. If none,\n",
      "     |                 all annotations are returned. E.g. types=[PDF_ANNOT_LINE]\n",
      "     |                 will only yield line annotations.\n",
      "     |  \n",
      "     |  apply_redactions(page: fitz.Page, images: int = 2, graphics: int = 1) -> bool\n",
      "     |      Apply the redaction annotations of the page.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          page: the PDF page.\n",
      "     |          images:\n",
      "     |                0 - ignore images\n",
      "     |                1 - remove all overlapping images\n",
      "     |                2 - blank out overlapping image parts\n",
      "     |                3 - remove image unless invisible\n",
      "     |          graphics:\n",
      "     |                0 - ignore graphics\n",
      "     |                1 - remove graphics if contained in rectangle\n",
      "     |                2 - remove all overlapping graphics\n",
      "     |  \n",
      "     |  bound(self)\n",
      "     |      Get page rectangle.\n",
      "     |  \n",
      "     |  clean_contents(self, sanitize=1)\n",
      "     |  \n",
      "     |  delete_annot(self, annot)\n",
      "     |      Delete annot and return next one.\n",
      "     |  \n",
      "     |  delete_image(page: fitz.Page, xref: int)\n",
      "     |      Delete the image referred to by xef.\n",
      "     |      \n",
      "     |      Actually replaces by a small transparent Pixmap using method Page.replace_image.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          xref: xref of the image to delete.\n",
      "     |  \n",
      "     |  delete_link(self, linkdict)\n",
      "     |      Delete a Link.\n",
      "     |  \n",
      "     |  delete_widget(page: fitz.Page, widget: fitz.Widget) -> fitz.Widget\n",
      "     |      Delete widget from page and return the next one.\n",
      "     |  \n",
      "     |  draw_bezier(page: fitz.Page, p1: 'point_like', p2: 'point_like', p3: 'point_like', p4: 'point_like', color: Optional[Sequence] = (0,), fill: Optional[Sequence] = None, dashes: Optional[str] = None, width: float = 1, morph: Optional[str] = None, closePath: bool = False, lineCap: int = 0, lineJoin: int = 0, overlay: bool = True, stroke_opacity: float = 1, fill_opacity: float = 1, oc: int = 0) -> fitz.Point\n",
      "     |      Draw a general cubic Bezier curve from p1 to p4 using control points p2 and p3.\n",
      "     |  \n",
      "     |  draw_circle(page: fitz.Page, center: 'point_like', radius: float, color: Optional[Sequence] = (0,), fill: Optional[Sequence] = None, morph: Optional[Sequence] = None, dashes: Optional[str] = None, width: float = 1, lineCap: int = 0, lineJoin: int = 0, overlay: bool = True, stroke_opacity: float = 1, fill_opacity: float = 1, oc: int = 0) -> fitz.Point\n",
      "     |      Draw a circle given its center and radius.\n",
      "     |  \n",
      "     |  draw_curve(page: fitz.Page, p1: 'point_like', p2: 'point_like', p3: 'point_like', color: Optional[Sequence] = (0,), fill: Optional[Sequence] = None, dashes: Optional[str] = None, width: float = 1, morph: Optional[Sequence] = None, closePath: bool = False, lineCap: int = 0, lineJoin: int = 0, overlay: bool = True, stroke_opacity: float = 1, fill_opacity: float = 1, oc: int = 0) -> fitz.Point\n",
      "     |      Draw a special Bezier curve from p1 to p3, generating control points on lines p1 to p2 and p2 to p3.\n",
      "     |  \n",
      "     |  draw_line(page: fitz.Page, p1: 'point_like', p2: 'point_like', color: Optional[Sequence] = (0,), dashes: Optional[str] = None, width: float = 1, lineCap: int = 0, lineJoin: int = 0, overlay: bool = True, morph: Optional[Sequence] = None, stroke_opacity: float = 1, fill_opacity: float = 1, oc=0) -> fitz.Point\n",
      "     |      Draw a line from point p1 to point p2.\n",
      "     |  \n",
      "     |  draw_oval(page: fitz.Page, rect: Union[ForwardRef('rect_like'), ForwardRef('quad_like')], color: Optional[Sequence] = (0,), fill: Optional[Sequence] = None, dashes: Optional[str] = None, morph: Optional[Sequence] = None, width: float = 1, lineCap: int = 0, lineJoin: int = 0, overlay: bool = True, stroke_opacity: float = 1, fill_opacity: float = 1, oc: int = 0) -> fitz.Point\n",
      "     |      Draw an oval given its containing rectangle or quad.\n",
      "     |  \n",
      "     |  draw_polyline(page: fitz.Page, points: list, color: Optional[Sequence] = (0,), fill: Optional[Sequence] = None, dashes: Optional[str] = None, width: float = 1, morph: Optional[Sequence] = None, lineCap: int = 0, lineJoin: int = 0, overlay: bool = True, closePath: bool = False, stroke_opacity: float = 1, fill_opacity: float = 1, oc: int = 0) -> fitz.Point\n",
      "     |      Draw multiple connected line segments.\n",
      "     |  \n",
      "     |  draw_quad(page: fitz.Page, quad: 'quad_like', color: Optional[Sequence] = (0,), fill: Optional[Sequence] = None, dashes: Optional[str] = None, width: float = 1, lineCap: int = 0, lineJoin: int = 0, morph: Optional[Sequence] = None, overlay: bool = True, stroke_opacity: float = 1, fill_opacity: float = 1, oc: int = 0) -> fitz.Point\n",
      "     |      Draw a quadrilateral.\n",
      "     |  \n",
      "     |  draw_rect(page: fitz.Page, rect: 'rect_like', color: Optional[Sequence] = (0,), fill: Optional[Sequence] = None, dashes: Optional[str] = None, width: float = 1, lineCap: int = 0, lineJoin: int = 0, morph: Optional[Sequence] = None, overlay: bool = True, stroke_opacity: float = 1, fill_opacity: float = 1, oc: int = 0, radius=None) -> fitz.Point\n",
      "     |      Draw a rectangle. See Shape class method for details.\n",
      "     |  \n",
      "     |  draw_sector(page: fitz.Page, center: 'point_like', point: 'point_like', beta: float, color: Optional[Sequence] = (0,), fill: Optional[Sequence] = None, dashes: Optional[str] = None, fullSector: bool = True, morph: Optional[Sequence] = None, width: float = 1, closePath: bool = False, lineCap: int = 0, lineJoin: int = 0, overlay: bool = True, stroke_opacity: float = 1, fill_opacity: float = 1, oc: int = 0) -> fitz.Point\n",
      "     |      Draw a circle sector given circle center, one arc end point and the angle of the arc.\n",
      "     |      \n",
      "     |      Parameters:\n",
      "     |          center -- center of circle\n",
      "     |          point -- arc end point\n",
      "     |          beta -- angle of arc (degrees)\n",
      "     |          fullSector -- connect arc ends with center\n",
      "     |  \n",
      "     |  draw_squiggle(page: fitz.Page, p1: 'point_like', p2: 'point_like', breadth: float = 2, color: Optional[Sequence] = (0,), dashes: Optional[str] = None, width: float = 1, lineCap: int = 0, lineJoin: int = 0, overlay: bool = True, morph: Optional[Sequence] = None, stroke_opacity: float = 1, fill_opacity: float = 1, oc: int = 0) -> fitz.Point\n",
      "     |      Draw a squiggly line from point p1 to point p2.\n",
      "     |  \n",
      "     |  draw_zigzag(page: fitz.Page, p1: 'point_like', p2: 'point_like', breadth: float = 2, color: Optional[Sequence] = (0,), dashes: Optional[str] = None, width: float = 1, lineCap: int = 0, lineJoin: int = 0, overlay: bool = True, morph: Optional[Sequence] = None, stroke_opacity: float = 1, fill_opacity: float = 1, oc: int = 0) -> fitz.Point\n",
      "     |      Draw a zigzag line from point p1 to point p2.\n",
      "     |  \n",
      "     |  extend_textpage(self, tpage, flags=0, matrix=None)\n",
      "     |  \n",
      "     |  find_tables(page, clip=None, vertical_strategy: str = 'lines', horizontal_strategy: str = 'lines', vertical_lines: list = None, horizontal_lines: list = None, snap_tolerance: float = 3, snap_x_tolerance: float = None, snap_y_tolerance: float = None, join_tolerance: float = 3, join_x_tolerance: float = None, join_y_tolerance: float = None, edge_min_length: float = 3, min_words_vertical: float = 3, min_words_horizontal: float = 1, intersection_tolerance: float = 3, intersection_x_tolerance: float = None, intersection_y_tolerance: float = None, text_tolerance=3, text_x_tolerance=3, text_y_tolerance=3, strategy=None, add_lines=None)\n",
      "     |  \n",
      "     |  get_bboxlog(self, layers=None)\n",
      "     |  \n",
      "     |  get_cdrawings(self, extended=None, callback=None, method=None)\n",
      "     |      Extract vector graphics (\"line art\") from the page.\n",
      "     |  \n",
      "     |  get_contents(self)\n",
      "     |      Get xrefs of /Contents objects.\n",
      "     |  \n",
      "     |  get_displaylist(self, annots=1)\n",
      "     |      Make a DisplayList from the page for Pixmap generation.\n",
      "     |      \n",
      "     |      Include (default) or exclude annotations.\n",
      "     |  \n",
      "     |  get_drawings(self, extended: bool = False) -> list\n",
      "     |      Retrieve vector graphics. The extended version includes clips.\n",
      "     |      \n",
      "     |      Note:\n",
      "     |      For greater comfort, this method converts point-likes, rect-likes, quad-likes\n",
      "     |      of the C version to respective Point / Rect / Quad objects.\n",
      "     |      It also adds default items that are missing in original path types.\n",
      "     |  \n",
      "     |  get_fonts(self, full=False)\n",
      "     |      List of fonts defined in the page object.\n",
      "     |  \n",
      "     |  get_image_bbox(self, name, transform=0)\n",
      "     |      Get rectangle occupied by image 'name'.\n",
      "     |      \n",
      "     |      'name' is either an item of the image list, or the referencing\n",
      "     |      name string - elem[7] of the resp. item.\n",
      "     |      Option 'transform' also returns the image transformation matrix.\n",
      "     |  \n",
      "     |  get_image_info(page: fitz.Page, hashes: bool = False, xrefs: bool = False) -> list\n",
      "     |      Extract image information only from a fitz.TextPage.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          hashes: (bool) include MD5 hash for each image.\n",
      "     |          xrefs: (bool) try to find the xref for each image. Sets hashes to true.\n",
      "     |  \n",
      "     |  get_image_rects(page: fitz.Page, name, transform=False) -> list\n",
      "     |      Return list of image positions on a page.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          name: (str, list, int) image identification. May be reference name, an\n",
      "     |                item of the page's image list or an xref.\n",
      "     |          transform: (bool) whether to also return the transformation matrix.\n",
      "     |      Returns:\n",
      "     |          A list of fitz.Rect objects or tuples of (fitz.Rect, fitz.Matrix) for all image\n",
      "     |          locations on the page.\n",
      "     |  \n",
      "     |  get_images(self, full=False)\n",
      "     |      List of images defined in the page object.\n",
      "     |  \n",
      "     |  get_label(page)\n",
      "     |      Return the label for this PDF page.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          page: page object.\n",
      "     |      Returns:\n",
      "     |          The label (str) of the page. Errors return an empty string.\n",
      "     |  \n",
      "     |  get_links(page: fitz.Page) -> list\n",
      "     |      Create a list of all links contained in a PDF page.\n",
      "     |      \n",
      "     |      Notes:\n",
      "     |          see PyMuPDF ducmentation for details.\n",
      "     |  \n",
      "     |  get_oc_items(self) -> list\n",
      "     |      Get OCGs and OCMDs used in the page's contents.\n",
      "     |      \n",
      "     |      Returns:\n",
      "     |          List of items (name, xref, type), where type is one of \"ocg\" / \"ocmd\",\n",
      "     |          and name is the property name.\n",
      "     |  \n",
      "     |  get_pixmap(page: fitz.Page, *, matrix: 'matrix_like' = IdentityMatrix(1.0, 0.0, 0.0, 1.0, 0.0, 0.0), dpi=None, colorspace: fitz.Colorspace = Colorspace(CS_RGB) - DeviceRGB, clip: 'rect_like' = None, alpha: bool = False, annots: bool = True) -> fitz.Pixmap\n",
      "     |      Create pixmap of page.\n",
      "     |      \n",
      "     |      Keyword args:\n",
      "     |          matrix: Matrix for transformation (default: Identity).\n",
      "     |          dpi: desired dots per inch. If given, matrix is ignored.\n",
      "     |          colorspace: (str/Colorspace) cmyk, rgb, gray - case ignored, default csRGB.\n",
      "     |          clip: (irect-like) restrict rendering to this area.\n",
      "     |          alpha: (bool) whether to include alpha channel\n",
      "     |          annots: (bool) whether to also render annotations\n",
      "     |  \n",
      "     |  get_svg_image(self, matrix=None, text_as_path=1)\n",
      "     |      Make SVG image from page.\n",
      "     |  \n",
      "     |  get_text(page: fitz.Page, option: str = 'text', clip: 'rect_like' = None, flags: Optional[int] = None, textpage: fitz.TextPage = None, sort: bool = False, delimiters=None)\n",
      "     |      Extract text from a page or an annotation.\n",
      "     |      \n",
      "     |      This is a unifying wrapper for various methods of the fitz.TextPage class.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          option: (str) text, words, blocks, html, dict, json, rawdict, xhtml or xml.\n",
      "     |          clip: (rect-like) restrict output to this area.\n",
      "     |          flags: bit switches to e.g. exclude images or decompose ligatures.\n",
      "     |          textpage: reuse this fitz.TextPage and make no new one. If specified,\n",
      "     |              'flags' and 'clip' are ignored.\n",
      "     |      \n",
      "     |      Returns:\n",
      "     |          the output of methods get_text_words / get_text_blocks or fitz.TextPage\n",
      "     |          methods extractText, extractHTML, extractDICT, extractJSON, extractRAWDICT,\n",
      "     |          extractXHTML or etractXML respectively.\n",
      "     |          Default and misspelling choice is \"text\".\n",
      "     |  \n",
      "     |  get_text_blocks(page: fitz.Page, clip: 'rect_like' = None, flags: Optional[int] = None, textpage: fitz.TextPage = None, sort: bool = False) -> list\n",
      "     |      Return the text blocks on a page.\n",
      "     |      \n",
      "     |      Notes:\n",
      "     |          Lines in a block are concatenated with line breaks.\n",
      "     |      Args:\n",
      "     |          flags: (int) control the amount of data parsed into the textpage.\n",
      "     |      Returns:\n",
      "     |          A list of the blocks. Each item contains the containing rectangle\n",
      "     |          coordinates, text lines, block type and running block number.\n",
      "     |  \n",
      "     |  get_text_selection(page: fitz.Page, p1: 'point_like', p2: 'point_like', clip: 'rect_like' = None, textpage: fitz.TextPage = None)\n",
      "     |  \n",
      "     |  get_text_words(page: fitz.Page, clip: 'rect_like' = None, flags: Optional[int] = None, textpage: fitz.TextPage = None, sort: bool = False, delimiters=None) -> list\n",
      "     |      Return the text words as a list with the bbox for each word.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          flags: (int) control the amount of data parsed into the textpage.\n",
      "     |          delimiters: (str,list) characters to use as word delimiters\n",
      "     |      \n",
      "     |      Returns:\n",
      "     |          Word tuples (x0, y0, x1, y1, \"word\", bno, lno, wno).\n",
      "     |  \n",
      "     |  get_textbox(page: fitz.Page, rect: 'rect_like', textpage: fitz.TextPage = None) -> str\n",
      "     |  \n",
      "     |  get_textpage(self, clip: 'rect_like' = None, flags: int = 0, matrix=None) -> 'TextPage'\n",
      "     |  \n",
      "     |  get_textpage_ocr(page: fitz.Page, flags: int = 0, language: str = 'eng', dpi: int = 72, full: bool = False, tessdata: str = None) -> fitz.TextPage\n",
      "     |      Create a Textpage from combined results of normal and OCR text parsing.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          flags: (int) control content becoming part of the result.\n",
      "     |          language: (str) specify expected language(s). Deafault is \"eng\" (English).\n",
      "     |          dpi: (int) resolution in dpi, default 72.\n",
      "     |          full: (bool) whether to OCR the full page image, or only its images (default)\n",
      "     |  \n",
      "     |  get_texttrace(self)\n",
      "     |  \n",
      "     |  get_xobjects(self)\n",
      "     |      List of xobjects defined in the page object.\n",
      "     |  \n",
      "     |  insert_font(self, fontname='helv', fontfile=None, fontbuffer=None, set_simple=False, wmode=0, encoding=0)\n",
      "     |  \n",
      "     |  insert_htmlbox(page, rect, text, *, css=None, scale_low=0, archive=None, rotate=0, oc=0, opacity=1, overlay=True) -> float\n",
      "     |      Insert text with optional HTML tags and stylings into a rectangle.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          rect: (rect-like) rectangle into which the text should be placed.\n",
      "     |          text: (str) text with optional HTML tags and stylings.\n",
      "     |          css: (str) CSS styling commands.\n",
      "     |          scale_low: (float) force-fit content by scaling it down. Must be in\n",
      "     |              range [0, 1]. If 1, no scaling will take place. If 0, arbitrary\n",
      "     |              down-scaling is acceptable. A value of 0.1 would mean that content\n",
      "     |              may be scaled down by at most 90%.\n",
      "     |          archive: Archive object pointing to locations of used fonts or images\n",
      "     |          rotate: (int) rotate the text in the box by a multiple of 90 degrees.\n",
      "     |          oc: (int) the xref of an OCG / OCMD (Optional Content).\n",
      "     |          opacity: (float) set opacity of inserted content.\n",
      "     |          overlay: (bool) put text on top of page content.\n",
      "     |      Returns:\n",
      "     |          A tuple of floats (spare_height, scale).\n",
      "     |          spare_height: -1 if content did not fit, else >= 0. It is the height of the\n",
      "     |                 unused (still available) rectangle stripe. Positive only if\n",
      "     |                 scale_min = 1 (no down scaling).\n",
      "     |          scale: downscaling factor, 0 < scale <= 1. Set to 0 if spare_height = -1 (no fit).\n",
      "     |  \n",
      "     |  insert_image(page, rect, *, alpha=-1, filename=None, height=0, keep_proportion=True, mask=None, oc=0, overlay=True, pixmap=None, rotate=0, stream=None, width=0, xref=0)\n",
      "     |      Insert an image for display in a rectangle.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          rect: (rect_like) position of image on the page.\n",
      "     |          alpha: (int, optional) set to 0 if image has no transparency.\n",
      "     |          filename: (str, Path, file object) image filename.\n",
      "     |          height: (int)\n",
      "     |          keep_proportion: (bool) keep width / height ratio (default).\n",
      "     |          mask: (bytes, optional) image consisting of alpha values to use.\n",
      "     |          oc: (int) xref of OCG or OCMD to declare as Optional Content.\n",
      "     |          overlay: (bool) put in foreground (default) or background.\n",
      "     |          pixmap: (fitz.Pixmap) use this as image.\n",
      "     |          rotate: (int) rotate by 0, 90, 180 or 270 degrees.\n",
      "     |          stream: (bytes) use this as image.\n",
      "     |          width: (int)\n",
      "     |          xref: (int) use this as image.\n",
      "     |      \n",
      "     |      'page' and 'rect' are positional, all other parameters are keywords.\n",
      "     |      \n",
      "     |      If 'xref' is given, that image is used. Other input options are ignored.\n",
      "     |      Else, exactly one of pixmap, stream or filename must be given.\n",
      "     |      \n",
      "     |      'alpha=0' for non-transparent images improves performance significantly.\n",
      "     |      Affects stream and filename only.\n",
      "     |      \n",
      "     |      Optimum transparent insertions are possible by using filename / stream in\n",
      "     |      conjunction with a 'mask' image of alpha values.\n",
      "     |      \n",
      "     |      Returns:\n",
      "     |          xref (int) of inserted image. Re-use as argument for multiple insertions.\n",
      "     |  \n",
      "     |  insert_link(page: fitz.Page, lnk: dict, mark: bool = True) -> None\n",
      "     |      Insert a new link for the current page.\n",
      "     |  \n",
      "     |  insert_text(page: fitz.Page, point: 'point_like', text: Union[str, list], fontsize: float = 11, lineheight: Optional[float] = None, fontname: str = 'helv', fontfile: Optional[str] = None, set_simple: int = 0, encoding: int = 0, color: Optional[Sequence] = None, fill: Optional[Sequence] = None, border_width: float = 0.05, render_mode: int = 0, rotate: int = 0, morph: Optional[Sequence] = None, overlay: bool = True, stroke_opacity: float = 1, fill_opacity: float = 1, oc: int = 0)\n",
      "     |  \n",
      "     |  insert_textbox(page: fitz.Page, rect: 'rect_like', buffer: Union[str, list], fontname: str = 'helv', fontfile: Optional[str] = None, set_simple: int = 0, encoding: int = 0, fontsize: float = 11, lineheight: Optional[float] = None, color: Optional[Sequence] = None, fill: Optional[Sequence] = None, expandtabs: int = 1, align: int = 0, rotate: int = 0, render_mode: int = 0, border_width: float = 0.05, morph: Optional[Sequence] = None, overlay: bool = True, stroke_opacity: float = 1, fill_opacity: float = 1, oc: int = 0) -> float\n",
      "     |      Insert text into a given rectangle.\n",
      "     |      \n",
      "     |      Notes:\n",
      "     |          Creates a Shape object, uses its same-named method and commits it.\n",
      "     |      Parameters:\n",
      "     |          rect: (rect-like) area to use for text.\n",
      "     |          buffer: text to be inserted\n",
      "     |          fontname: a Base-14 font, font name or '/name'\n",
      "     |          fontfile: name of a font file\n",
      "     |          fontsize: font size\n",
      "     |          lineheight: overwrite the font property\n",
      "     |          color: RGB color triple\n",
      "     |          expandtabs: handles tabulators with string function\n",
      "     |          align: left, center, right, justified\n",
      "     |          rotate: 0, 90, 180, or 270 degrees\n",
      "     |          morph: morph box with a matrix and a fixpoint\n",
      "     |          overlay: put text in foreground or background\n",
      "     |      Returns:\n",
      "     |          unused or deficit rectangle area (float)\n",
      "     |  \n",
      "     |  links(self, kinds=None)\n",
      "     |      Generator over the links of a page.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          kinds: (list) link kinds to subselect from. If none,\n",
      "     |                 all links are returned. E.g. kinds=[LINK_URI]\n",
      "     |                 will only yield URI links.\n",
      "     |  \n",
      "     |  load_annot(self, ident: Union[str, int]) -> fitz.Annot\n",
      "     |      Load an annot by name (/NM key) or xref.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          ident: identifier, either name (str) or xref (int).\n",
      "     |  \n",
      "     |  load_links(self)\n",
      "     |      Get first Link.\n",
      "     |  \n",
      "     |  load_widget(self, xref)\n",
      "     |      Load a widget by its xref.\n",
      "     |  \n",
      "     |  new_shape lambda x\n",
      "     |  \n",
      "     |  read_contents(self)\n",
      "     |      All /Contents streams concatenated to one bytes object.\n",
      "     |  \n",
      "     |  refresh(self)\n",
      "     |      Refresh page after link/annot/widget updates.\n",
      "     |  \n",
      "     |  replace_image(page: fitz.Page, xref: int, *, filename=None, pixmap=None, stream=None)\n",
      "     |      Replace the image referred to by xref.\n",
      "     |      \n",
      "     |      Replace the image by changing the object definition stored under xref. This\n",
      "     |      will leave the pages appearance instructions intact, so the new image is\n",
      "     |      being displayed with the same bbox, rotation etc.\n",
      "     |      By providing a small fully transparent image, an effect as if the image had\n",
      "     |      been deleted can be achieved.\n",
      "     |      A typical use may include replacing large images by a smaller version,\n",
      "     |      e.g. with a lower resolution or graylevel instead of colored.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          xref: the xref of the image to replace.\n",
      "     |          filename, pixmap, stream: exactly one of these must be provided. The\n",
      "     |              meaning being the same as in Page.insert_image.\n",
      "     |  \n",
      "     |  run(self, dw, m)\n",
      "     |      Run page through a device.\n",
      "     |      dw: DeviceWrapper\n",
      "     |  \n",
      "     |  search_for(page, text, *, clip=None, quads=False, flags=83, textpage=None) -> list\n",
      "     |      Search for a string on a page.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          text: string to be searched for\n",
      "     |          clip: restrict search to this rectangle\n",
      "     |          quads: (bool) return quads instead of rectangles\n",
      "     |          flags: bit switches, default: join hyphened words\n",
      "     |          textpage: a pre-created fitz.TextPage\n",
      "     |      Returns:\n",
      "     |          a list of rectangles or quads, each containing one occurrence.\n",
      "     |  \n",
      "     |  set_artbox(self, rect)\n",
      "     |      Set the ArtBox.\n",
      "     |  \n",
      "     |  set_bleedbox(self, rect)\n",
      "     |      Set the BleedBox.\n",
      "     |  \n",
      "     |  set_contents(self, xref)\n",
      "     |      Set object at 'xref' as the page's /Contents.\n",
      "     |  \n",
      "     |  set_cropbox(self, rect)\n",
      "     |      Set the CropBox. Will also change Page.rect.\n",
      "     |  \n",
      "     |  set_language(self, language=None)\n",
      "     |      Set PDF page default language.\n",
      "     |  \n",
      "     |  set_mediabox(self, rect)\n",
      "     |      Set the MediaBox.\n",
      "     |  \n",
      "     |  set_rotation(self, rotation)\n",
      "     |      Set page rotation.\n",
      "     |  \n",
      "     |  set_trimbox(self, rect)\n",
      "     |      Set the TrimBox.\n",
      "     |  \n",
      "     |  show_pdf_page(page, rect, src, pno=0, keep_proportion=True, overlay=True, oc=0, rotate=0, clip=None) -> int\n",
      "     |      Show page number 'pno' of PDF 'src' in rectangle 'rect'.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          rect: (rect-like) where to place the source image\n",
      "     |          src: (document) source PDF\n",
      "     |          pno: (int) source page number\n",
      "     |          keep_proportion: (bool) do not change width-height-ratio\n",
      "     |          overlay: (bool) put in foreground\n",
      "     |          oc: (xref) make visibility dependent on this OCG / OCMD (which must be defined in the target PDF)\n",
      "     |          rotate: (int) degrees (multiple of 90)\n",
      "     |          clip: (rect-like) part of source page rectangle\n",
      "     |      Returns:\n",
      "     |          xref of inserted object (for reuse)\n",
      "     |  \n",
      "     |  update_link(page: fitz.Page, lnk: dict) -> None\n",
      "     |      Update a link on the current page.\n",
      "     |  \n",
      "     |  widgets(self, types=None)\n",
      "     |      Generator over the widgets of a page.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          types: (list) field types to subselect from. If none,\n",
      "     |                  all fields are returned. E.g. types=[PDF_WIDGET_TYPE_TEXT]\n",
      "     |                  will only yield text fields.\n",
      "     |  \n",
      "     |  wrap_contents(self)\n",
      "     |  \n",
      "     |  write_text(page: fitz.Page, rect=None, writers=None, overlay=True, color=None, opacity=None, keep_proportion=True, rotate=0, oc=0) -> None\n",
      "     |      Write the text of one or more fitz.TextWriter objects.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          rect: target rectangle. If None, the union of the text writers is used.\n",
      "     |          writers: one or more fitz.TextWriter objects.\n",
      "     |          overlay: put in foreground or background.\n",
      "     |          keep_proportion: maintain aspect ratio of rectangle sides.\n",
      "     |          rotate: arbitrary rotation angle.\n",
      "     |          oc: the xref of an optional content object\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties defined here:\n",
      "     |  \n",
      "     |  artbox\n",
      "     |      The ArtBox\n",
      "     |  \n",
      "     |  bleedbox\n",
      "     |      The BleedBox\n",
      "     |  \n",
      "     |  cropbox\n",
      "     |      The CropBox.\n",
      "     |  \n",
      "     |  cropbox_position\n",
      "     |  \n",
      "     |  derotation_matrix\n",
      "     |      Reflects page de-rotation.\n",
      "     |  \n",
      "     |  first_annot\n",
      "     |      First annotation.\n",
      "     |  \n",
      "     |  first_link\n",
      "     |      First link on page\n",
      "     |  \n",
      "     |  first_widget\n",
      "     |      First widget/field.\n",
      "     |  \n",
      "     |  is_wrapped\n",
      "     |      Check if /Contents is wrapped with string pair \"q\" / \"Q\".\n",
      "     |  \n",
      "     |  language\n",
      "     |      Page language.\n",
      "     |  \n",
      "     |  mediabox\n",
      "     |      The MediaBox.\n",
      "     |  \n",
      "     |  mediabox_size\n",
      "     |  \n",
      "     |  rect\n",
      "     |      page rectangle\n",
      "     |  \n",
      "     |  rotation\n",
      "     |      Page rotation.\n",
      "     |  \n",
      "     |  rotation_matrix\n",
      "     |      Reflects page rotation.\n",
      "     |  \n",
      "     |  transformation_matrix\n",
      "     |      Page transformation matrix.\n",
      "     |  \n",
      "     |  trimbox\n",
      "     |      The TrimBox\n",
      "     |  \n",
      "     |  xref\n",
      "     |      PDF xref number of page.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class Pixmap(builtins.object)\n",
      "     |  Pixmap(*args)\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, *args)\n",
      "     |      Pixmap(colorspace, irect, alpha) - empty pixmap.\n",
      "     |      Pixmap(colorspace, src) - copy changing colorspace.\n",
      "     |      Pixmap(src, width, height,[clip]) - scaled copy, float dimensions.\n",
      "     |      Pixmap(src, alpha=1) - copy and add or drop alpha channel.\n",
      "     |      Pixmap(filename) - from an image in a file.\n",
      "     |      Pixmap(image) - from an image in memory (bytes).\n",
      "     |      Pixmap(colorspace, width, height, samples, alpha) - from samples data.\n",
      "     |      Pixmap(PDFdoc, xref) - from an image at xref in a PDF document.\n",
      "     |  \n",
      "     |  __len__(self)\n",
      "     |  \n",
      "     |  __repr__(self)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  clear_with(self, value=None, bbox=None)\n",
      "     |      Fill all color components with same value.\n",
      "     |  \n",
      "     |  color_count(self, colors=0, clip=None)\n",
      "     |      Return count of each color.\n",
      "     |  \n",
      "     |  color_topusage(self, clip=None)\n",
      "     |      Return most frequent color and its usage ratio.\n",
      "     |  \n",
      "     |  copy(self, src, bbox)\n",
      "     |      Copy bbox from another Pixmap.\n",
      "     |  \n",
      "     |  gamma_with(self, gamma)\n",
      "     |      Apply correction with some float.\n",
      "     |      gamma=1 is a no-op.\n",
      "     |  \n",
      "     |  invert_irect(self, bbox=None)\n",
      "     |      Invert the colors inside a bbox.\n",
      "     |  \n",
      "     |  pdfocr_save(self, filename, compress=1, language=None, tessdata=None)\n",
      "     |      Save pixmap as an OCR-ed PDF page.\n",
      "     |  \n",
      "     |  pdfocr_tobytes(self, compress=True, language='eng', tessdata=None)\n",
      "     |      Save pixmap as an OCR-ed PDF page.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          compress: (bool) compress, default 1 (True).\n",
      "     |          language: (str) language(s) occurring on page, default \"eng\" (English),\n",
      "     |                  multiples like \"eng+ger\" for English and German.\n",
      "     |          tessdata: (str) folder name of Tesseract's language support. Must be\n",
      "     |                  given if environment variable TESSDATA_PREFIX is not set.\n",
      "     |      Notes:\n",
      "     |          On failure, make sure Tesseract is installed and you have set the\n",
      "     |          environment variable \"TESSDATA_PREFIX\" to the folder containing your\n",
      "     |          Tesseract's language support data.\n",
      "     |  \n",
      "     |  pil_save(self, *args, **kwargs)\n",
      "     |      Write to image file using Pillow.\n",
      "     |      \n",
      "     |      Args are passed to Pillow's Image.save method, see their documentation.\n",
      "     |      Use instead of save when other output formats are desired.\n",
      "     |  \n",
      "     |  pil_tobytes(self, *args, **kwargs)\n",
      "     |      Convert to binary image stream using pillow.\n",
      "     |      \n",
      "     |      Args are passed to Pillow's Image.save method, see their documentation.\n",
      "     |      Use instead of 'tobytes' when other output formats are needed.\n",
      "     |  \n",
      "     |  pixel(self, x, y)\n",
      "     |      Get color tuple of pixel (x, y).\n",
      "     |      Last item is the alpha if Pixmap.alpha is true.\n",
      "     |  \n",
      "     |  save(self, filename, output=None, jpg_quality=95)\n",
      "     |      Output as image in format determined by filename extension.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          output: (str) only use to overrule filename extension. Default is PNG.\n",
      "     |                  Others are JPEG, JPG, PNM, PGM, PPM, PBM, PAM, PSD, PS.\n",
      "     |  \n",
      "     |  set_alpha(self, alphavalues=None, premultiply=1, opaque=None, matte=None)\n",
      "     |      Set alpha channel to values contained in a byte array.\n",
      "     |      If omitted, set alphas to 255.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          alphavalues: (bytes) with length (width * height) or 'None'.\n",
      "     |          premultiply: (bool, True) premultiply colors with alpha values.\n",
      "     |          opaque: (tuple, length colorspace.n) this color receives opacity 0.\n",
      "     |          matte: (tuple, length colorspace.n)) preblending background color.\n",
      "     |  \n",
      "     |  set_dpi(self, xres, yres)\n",
      "     |      Set resolution in both dimensions.\n",
      "     |  \n",
      "     |  set_origin(self, x, y)\n",
      "     |      Set top-left coordinates.\n",
      "     |  \n",
      "     |  set_pixel(self, x, y, color)\n",
      "     |      Set color of pixel (x, y).\n",
      "     |  \n",
      "     |  set_rect(self, bbox, color)\n",
      "     |      Set color of all pixels in bbox.\n",
      "     |  \n",
      "     |  shrink(self, factor)\n",
      "     |      Divide width and height by 2**factor.\n",
      "     |      E.g. factor=1 shrinks to 25% of original size (in place).\n",
      "     |  \n",
      "     |  tint_with(self, black, white)\n",
      "     |      Tint colors with modifiers for black and white.\n",
      "     |  \n",
      "     |  tobytes(self, output='png', jpg_quality=95)\n",
      "     |      Convert to binary image stream of desired type.\n",
      "     |  \n",
      "     |  warp(self, quad, width, height)\n",
      "     |      Return pixmap from a warped quad.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties defined here:\n",
      "     |  \n",
      "     |  alpha\n",
      "     |      Indicates presence of alpha channel.\n",
      "     |  \n",
      "     |  colorspace\n",
      "     |      Pixmap Colorspace.\n",
      "     |  \n",
      "     |  digest\n",
      "     |      MD5 digest of pixmap (bytes).\n",
      "     |  \n",
      "     |  h\n",
      "     |      The height.\n",
      "     |  \n",
      "     |  height\n",
      "     |      The height.\n",
      "     |  \n",
      "     |  irect\n",
      "     |      Pixmap bbox - an IRect object.\n",
      "     |  \n",
      "     |  is_monochrome\n",
      "     |      Check if pixmap is monochrome.\n",
      "     |  \n",
      "     |  is_unicolor\n",
      "     |      Check if pixmap has only one color.\n",
      "     |  \n",
      "     |  n\n",
      "     |      The size of one pixel.\n",
      "     |  \n",
      "     |  samples\n",
      "     |  \n",
      "     |  samples_mv\n",
      "     |      Pixmap samples memoryview.\n",
      "     |  \n",
      "     |  samples_ptr\n",
      "     |  \n",
      "     |  size\n",
      "     |      Pixmap size.\n",
      "     |  \n",
      "     |  stride\n",
      "     |      Length of one image line (width * n).\n",
      "     |  \n",
      "     |  w\n",
      "     |      The width.\n",
      "     |  \n",
      "     |  width\n",
      "     |      The width.\n",
      "     |  \n",
      "     |  x\n",
      "     |      x component of Pixmap origin.\n",
      "     |  \n",
      "     |  xres\n",
      "     |      Resolution in x direction.\n",
      "     |  \n",
      "     |  y\n",
      "     |      y component of Pixmap origin.\n",
      "     |  \n",
      "     |  yres\n",
      "     |      Resolution in y direction.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class Point(builtins.object)\n",
      "     |  Point(*args, x=None, y=None)\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __abs__(self)\n",
      "     |  \n",
      "     |  __add__(self, p)\n",
      "     |  \n",
      "     |  __bool__(self)\n",
      "     |  \n",
      "     |  __div__ = __truediv__(self, m)\n",
      "     |  \n",
      "     |  __eq__(self, p)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __getitem__(self, i)\n",
      "     |  \n",
      "     |  __hash__(self)\n",
      "     |      Return hash(self).\n",
      "     |  \n",
      "     |  __init__(self, *args, x=None, y=None)\n",
      "     |      Point() - all zeros\n",
      "     |      Point(x, y)\n",
      "     |      Point(Point) - new copy\n",
      "     |      Point(sequence) - from 'sequence'\n",
      "     |      \n",
      "     |      Explicit keyword args x, y override earlier settings if not None.\n",
      "     |  \n",
      "     |  __len__(self)\n",
      "     |  \n",
      "     |  __mul__(self, m)\n",
      "     |  \n",
      "     |  __neg__(self)\n",
      "     |  \n",
      "     |  __nonzero__(self)\n",
      "     |  \n",
      "     |  __pos__(self)\n",
      "     |  \n",
      "     |  __repr__(self)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __setitem__(self, i, v)\n",
      "     |  \n",
      "     |  __sub__(self, p)\n",
      "     |  \n",
      "     |  __truediv__(self, m)\n",
      "     |  \n",
      "     |  distance_to(self, *args)\n",
      "     |      Return distance to rectangle or another point.\n",
      "     |  \n",
      "     |  norm = __abs__(self)\n",
      "     |  \n",
      "     |  transform(self, m)\n",
      "     |      Replace point by its transformation with matrix-like m.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties defined here:\n",
      "     |  \n",
      "     |  abs_unit\n",
      "     |      Unit vector with positive coordinates.\n",
      "     |  \n",
      "     |  unit\n",
      "     |      Unit vector of the point.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class Quad(builtins.object)\n",
      "     |  Quad(*args, ul=None, ur=None, ll=None, lr=None)\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __abs__(self)\n",
      "     |  \n",
      "     |  __add__(self, q)\n",
      "     |  \n",
      "     |  __bool__(self)\n",
      "     |  \n",
      "     |  __contains__(self, x)\n",
      "     |  \n",
      "     |  __div__ = __truediv__(self, m)\n",
      "     |  \n",
      "     |  __eq__(self, quad)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __getitem__(self, i)\n",
      "     |  \n",
      "     |  __hash__(self)\n",
      "     |      Return hash(self).\n",
      "     |  \n",
      "     |  __init__(self, *args, ul=None, ur=None, ll=None, lr=None)\n",
      "     |      Quad() - all zero points\n",
      "     |      Quad(ul, ur, ll, lr)\n",
      "     |      Quad(quad) - new copy\n",
      "     |      Quad(sequence) - from 'sequence'\n",
      "     |      \n",
      "     |      Explicit keyword args ul, ur, ll, lr override earlier settings if not\n",
      "     |      None.\n",
      "     |  \n",
      "     |  __len__(self)\n",
      "     |  \n",
      "     |  __mul__(self, m)\n",
      "     |  \n",
      "     |  __neg__(self)\n",
      "     |  \n",
      "     |  __nonzero__(self)\n",
      "     |  \n",
      "     |  __pos__(self)\n",
      "     |  \n",
      "     |  __repr__(self)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __setitem__(self, i, v)\n",
      "     |  \n",
      "     |  __sub__(self, q)\n",
      "     |  \n",
      "     |  __truediv__(self, m)\n",
      "     |  \n",
      "     |  morph(self, p, m)\n",
      "     |      Morph the quad with matrix-like 'm' and point-like 'p'.\n",
      "     |      \n",
      "     |      Return a new quad.\n",
      "     |  \n",
      "     |  transform(self, m)\n",
      "     |      Replace quad by its transformation with matrix m.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties defined here:\n",
      "     |  \n",
      "     |  height\n",
      "     |  \n",
      "     |  is_convex\n",
      "     |      Check if quad is convex and not degenerate.\n",
      "     |      \n",
      "     |      Notes:\n",
      "     |          Check that for the two diagonals, the other two corners are not\n",
      "     |          on the same side of the diagonal.\n",
      "     |      Returns:\n",
      "     |          True or False.\n",
      "     |  \n",
      "     |  is_empty\n",
      "     |      Check whether all quad corners are on the same line.\n",
      "     |      \n",
      "     |      This is the case if width or height is zero.\n",
      "     |  \n",
      "     |  is_infinite\n",
      "     |      Check whether this is the infinite quad.\n",
      "     |  \n",
      "     |  is_rectangular\n",
      "     |      Check if quad is rectangular.\n",
      "     |      \n",
      "     |      Notes:\n",
      "     |          Some rotation matrix can thus transform it into a rectangle.\n",
      "     |          This is equivalent to three corners enclose 90 degrees.\n",
      "     |      Returns:\n",
      "     |          True or False.\n",
      "     |  \n",
      "     |  rect\n",
      "     |  \n",
      "     |  width\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class Rect(builtins.object)\n",
      "     |  Rect(*args, p0=None, p1=None, x0=None, y0=None, x1=None, y1=None)\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __abs__(self)\n",
      "     |  \n",
      "     |  __add__(self, p)\n",
      "     |  \n",
      "     |  __and__(self, x)\n",
      "     |  \n",
      "     |  __bool__(self)\n",
      "     |  \n",
      "     |  __contains__(self, x)\n",
      "     |  \n",
      "     |  __div__ = __truediv__(self, m)\n",
      "     |  \n",
      "     |  __eq__(self, rect)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __getitem__(self, i)\n",
      "     |  \n",
      "     |  __hash__(self)\n",
      "     |      Return hash(self).\n",
      "     |  \n",
      "     |  __init__(self, *args, p0=None, p1=None, x0=None, y0=None, x1=None, y1=None)\n",
      "     |      Rect() - all zeros\n",
      "     |      Rect(x0, y0, x1, y1)\n",
      "     |      Rect(top-left, x1, y1)\n",
      "     |      Rect(x0, y0, bottom-right)\n",
      "     |      Rect(top-left, bottom-right)\n",
      "     |      Rect(Rect or IRect) - new copy\n",
      "     |      Rect(sequence) - from 'sequence'\n",
      "     |      \n",
      "     |      Explicit keyword args p0, p1, x0, y0, x1, y1 override earlier settings\n",
      "     |      if not None.\n",
      "     |  \n",
      "     |  __len__(self)\n",
      "     |  \n",
      "     |  __mul__(self, m)\n",
      "     |  \n",
      "     |  __neg__(self)\n",
      "     |  \n",
      "     |  __nonzero__(self)\n",
      "     |  \n",
      "     |  __or__(self, x)\n",
      "     |  \n",
      "     |  __pos__(self)\n",
      "     |  \n",
      "     |  __repr__(self)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __setitem__(self, i, v)\n",
      "     |  \n",
      "     |  __sub__(self, p)\n",
      "     |  \n",
      "     |  __truediv__(self, m)\n",
      "     |  \n",
      "     |  contains(self, x)\n",
      "     |      Check if containing point-like or rect-like x.\n",
      "     |  \n",
      "     |  get_area(*args) -> float\n",
      "     |      Calculate area of rectangle.\n",
      "     |      parameter is one of 'px' (default), 'in', 'cm', or 'mm'.\n",
      "     |  \n",
      "     |  include_point(self, p)\n",
      "     |      Extend to include point-like p.\n",
      "     |  \n",
      "     |  include_rect(self, r)\n",
      "     |      Extend to include rect-like r.\n",
      "     |  \n",
      "     |  intersect(self, r)\n",
      "     |      Restrict to common rect with rect-like r.\n",
      "     |  \n",
      "     |  intersects(self, x)\n",
      "     |      Check if intersection with rectangle x is not empty.\n",
      "     |  \n",
      "     |  morph(self, p, m)\n",
      "     |      Morph with matrix-like m and point-like p.\n",
      "     |      \n",
      "     |      Returns a new quad.\n",
      "     |  \n",
      "     |  norm(self)\n",
      "     |  \n",
      "     |  normalize(self)\n",
      "     |      Replace rectangle with its finite version.\n",
      "     |  \n",
      "     |  round(self)\n",
      "     |      Return the IRect.\n",
      "     |  \n",
      "     |  torect(self, r)\n",
      "     |      Return matrix that converts to target rect.\n",
      "     |  \n",
      "     |  transform(self, m)\n",
      "     |      Replace with the transformation by matrix-like m.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties defined here:\n",
      "     |  \n",
      "     |  bl\n",
      "     |      Bottom-left corner.\n",
      "     |  \n",
      "     |  bottom_left\n",
      "     |      Bottom-left corner.\n",
      "     |  \n",
      "     |  bottom_right\n",
      "     |      Bottom-right corner.\n",
      "     |  \n",
      "     |  br\n",
      "     |      Bottom-right corner.\n",
      "     |  \n",
      "     |  height\n",
      "     |  \n",
      "     |  irect\n",
      "     |      Return the IRect.\n",
      "     |  \n",
      "     |  is_empty\n",
      "     |      True if rectangle area is empty.\n",
      "     |  \n",
      "     |  is_infinite\n",
      "     |      True if this is the infinite rectangle.\n",
      "     |  \n",
      "     |  is_valid\n",
      "     |      True if rectangle is valid.\n",
      "     |  \n",
      "     |  quad\n",
      "     |      Return Quad version of rectangle.\n",
      "     |  \n",
      "     |  tl\n",
      "     |      Top-left corner.\n",
      "     |  \n",
      "     |  top_left\n",
      "     |      Top-left corner.\n",
      "     |  \n",
      "     |  top_right\n",
      "     |      Top-right corner.\n",
      "     |  \n",
      "     |  tr\n",
      "     |      Top-right corner.\n",
      "     |  \n",
      "     |  width\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class Shape(builtins.object)\n",
      "     |  Shape(page: fitz.Page)\n",
      "     |  \n",
      "     |  Create a new shape.\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, page: fitz.Page)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  commit(self, overlay: bool = True) -> None\n",
      "     |      Update the page's /Contents object with Shape data. The argument\n",
      "     |      controls whether data appear in foreground (default) or background.\n",
      "     |  \n",
      "     |  draw_bezier(self, p1: 'point_like', p2: 'point_like', p3: 'point_like', p4: 'point_like')\n",
      "     |      Draw a standard cubic Bezier curve.\n",
      "     |  \n",
      "     |  draw_circle(self, center: 'point_like', radius: float)\n",
      "     |      Draw a circle given its center and radius.\n",
      "     |  \n",
      "     |  draw_curve(self, p1: 'point_like', p2: 'point_like', p3: 'point_like')\n",
      "     |      Draw a curve between points using one control point.\n",
      "     |  \n",
      "     |  draw_line(self, p1: 'point_like', p2: 'point_like')\n",
      "     |      Draw a line between two points.\n",
      "     |  \n",
      "     |  draw_oval(self, tetra: Union[ForwardRef('quad_like'), ForwardRef('rect_like')])\n",
      "     |      Draw an ellipse inside a tetrapod.\n",
      "     |  \n",
      "     |  draw_polyline(self, points: list)\n",
      "     |      Draw several connected line segments.\n",
      "     |  \n",
      "     |  draw_quad(self, quad: 'quad_like')\n",
      "     |      Draw a Quad.\n",
      "     |  \n",
      "     |  draw_rect(self, rect: 'rect_like')\n",
      "     |      Draw a rectangle.\n",
      "     |  \n",
      "     |  draw_sector(self, center: 'point_like', point: 'point_like', beta: float, fullSector: bool = True)\n",
      "     |      Draw a circle sector.\n",
      "     |  \n",
      "     |  draw_squiggle(self, p1: 'point_like', p2: 'point_like', breadth=2)\n",
      "     |      Draw a squiggly line from p1 to p2.\n",
      "     |  \n",
      "     |  draw_zigzag(self, p1: 'point_like', p2: 'point_like', breadth: float = 2)\n",
      "     |      Draw a zig-zagged line from p1 to p2.\n",
      "     |  \n",
      "     |  finish(self, width: float = 1, color: Optional[Sequence] = (0,), fill: Optional[Sequence] = None, lineCap: int = 0, lineJoin: int = 0, dashes: Optional[str] = None, even_odd: bool = False, morph: Optional[Sequence] = None, closePath: bool = True, fill_opacity: float = 1, stroke_opacity: float = 1, oc: int = 0) -> None\n",
      "     |      Finish the current drawing segment.\n",
      "     |      \n",
      "     |      Notes:\n",
      "     |          Apply colors, opacity, dashes, line style and width, or\n",
      "     |          morphing. Also whether to close the path\n",
      "     |          by connecting last to first point.\n",
      "     |  \n",
      "     |  insert_text(self, point: 'point_like', buffer_: Union[str, list], fontsize: float = 11, lineheight: Optional[float] = None, fontname: str = 'helv', fontfile: Optional[str] = None, set_simple: bool = 0, encoding: int = 0, color: Optional[Sequence] = None, fill: Optional[Sequence] = None, render_mode: int = 0, border_width: float = 1, rotate: int = 0, morph: Optional[Sequence] = None, stroke_opacity: float = 1, fill_opacity: float = 1, oc: int = 0) -> int\n",
      "     |  \n",
      "     |  insert_textbox(self, rect: 'rect_like', buffer_: Union[str, list], fontname: Optional[str] = 'helv', fontfile: Optional[str] = None, fontsize: float = 11, lineheight: Optional[float] = None, set_simple: bool = 0, encoding: int = 0, color: Optional[Sequence] = None, fill: Optional[Sequence] = None, expandtabs: int = 1, border_width: float = 1, align: int = 0, render_mode: int = 0, rotate: int = 0, morph: Optional[Sequence] = None, stroke_opacity: float = 1, fill_opacity: float = 1, oc: int = 0) -> float\n",
      "     |      Insert text into a given rectangle.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          rect -- the textbox to fill\n",
      "     |          buffer_ -- text to be inserted\n",
      "     |          fontname -- a Base-14 font, font name or '/name'\n",
      "     |          fontfile -- name of a font file\n",
      "     |          fontsize -- font size\n",
      "     |          lineheight -- overwrite the font property\n",
      "     |          color -- RGB stroke color triple\n",
      "     |          fill -- RGB fill color triple\n",
      "     |          render_mode -- text rendering control\n",
      "     |          border_width -- thickness of glyph borders\n",
      "     |          expandtabs -- handles tabulators with string function\n",
      "     |          align -- left, center, right, justified\n",
      "     |          rotate -- 0, 90, 180, or 270 degrees\n",
      "     |          morph -- morph box with a matrix and a fixpoint\n",
      "     |      Returns:\n",
      "     |          unused or deficit rectangle area (float)\n",
      "     |  \n",
      "     |  update_rect(self, x)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods defined here:\n",
      "     |  \n",
      "     |  horizontal_angle(C, P)\n",
      "     |      Return the angle to the horizontal for the connection from C to P.\n",
      "     |      This uses the arcus sine function and resolves its inherent ambiguity by\n",
      "     |      looking up in which quadrant vector S = P - C is located.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class Story(builtins.object)\n",
      "     |  Story(html='', user_css=None, em=12, archive=None)\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, html='', user_css=None, em=12, archive=None)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  add_header_ids(self)\n",
      "     |      Look for `<h1..6>` items in `self` and adds unique `id`\n",
      "     |      attributes if not already present.\n",
      "     |  \n",
      "     |  document(self)\n",
      "     |  \n",
      "     |  draw(self, device, matrix=None)\n",
      "     |  \n",
      "     |  element_positions(self, function, args=None)\n",
      "     |      Trigger a callback function to record where items have been placed.\n",
      "     |  \n",
      "     |  fit(self, fn, pmin=None, pmax=None, delta=0.001, verbose=False)\n",
      "     |      Finds optimal rect that contains the story `self`.\n",
      "     |      \n",
      "     |      Returns a `Story.FitResult` instance.\n",
      "     |          \n",
      "     |      On success, the last call to `self.place()` will have been with the\n",
      "     |      returned rectangle, so `self.draw()` can be used directly.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |      :arg fn:\n",
      "     |          A callable taking a floating point `parameter` and returning a\n",
      "     |          `fitz.Rect()`. If the rect is empty, we assume the story will\n",
      "     |          not fit and do not call `self.place()`.\n",
      "     |      \n",
      "     |          Must guarantee that `self.place()` behaves monotonically when\n",
      "     |          given rect `fn(parameter`) as `parameter` increases. This\n",
      "     |          usually means that both width and height increase or stay\n",
      "     |          unchanged as `parameter` increases.\n",
      "     |      :arg pmin:\n",
      "     |          Minimum parameter to consider; `None` for -infinity.\n",
      "     |      :arg pmax:\n",
      "     |          Maximum parameter to consider; `None` for +infinity.\n",
      "     |      :arg delta:\n",
      "     |          Maximum error in returned `parameter`.\n",
      "     |      :arg verbose:\n",
      "     |          If true we output diagnostics.\n",
      "     |  \n",
      "     |  fit_height(self, width, height_min=0, height_max=None, origin=(0, 0), delta=0.001, verbose=False)\n",
      "     |      Finds smallest height in range `height_min..height_max` where a rect\n",
      "     |      with size `(width, height)` is large enough to contain the story\n",
      "     |      `self`.\n",
      "     |      \n",
      "     |      Returns a `Story.FitResult` instance.\n",
      "     |      \n",
      "     |      :arg width:\n",
      "     |          width of rect.\n",
      "     |      :arg height_min:\n",
      "     |          Minimum height to consider; must be >= 0.\n",
      "     |      :arg height_max:\n",
      "     |          Maximum height to consider, must be >= height_min or `None` for\n",
      "     |          infinite.\n",
      "     |      :arg origin:\n",
      "     |          `(x0, y0)` of rect.\n",
      "     |      :arg delta:\n",
      "     |          Maximum error in returned height.\n",
      "     |      :arg verbose:\n",
      "     |          If true we output diagnostics.\n",
      "     |  \n",
      "     |  fit_scale(self, rect, scale_min=0, scale_max=None, delta=0.001, verbose=False)\n",
      "     |      Finds smallest value `scale` in range `scale_min..scale_max` where\n",
      "     |      `scale * rect` is large enough to contain the story `self`.\n",
      "     |      \n",
      "     |      Returns a `Story.FitResult` instance.\n",
      "     |      \n",
      "     |      :arg width:\n",
      "     |          width of rect.\n",
      "     |      :arg height:\n",
      "     |          height of rect.\n",
      "     |      :arg scale_min:\n",
      "     |          Minimum scale to consider; must be >= 0.\n",
      "     |      :arg scale_max:\n",
      "     |          Maximum scale to consider, must be >= scale_min or `None` for\n",
      "     |          infinite.\n",
      "     |      :arg delta:\n",
      "     |          Maximum error in returned scale.\n",
      "     |      :arg verbose:\n",
      "     |          If true we output diagnostics.\n",
      "     |  \n",
      "     |  fit_width(self, height, width_min=0, width_max=None, origin=(0, 0), delta=0.001, verbose=False)\n",
      "     |      Finds smallest width in range `width_min..width_max` where a rect with size\n",
      "     |      `(width, height)` is large enough to contain the story `self`.\n",
      "     |      \n",
      "     |      Returns a `Story.FitResult` instance.\n",
      "     |      Returns a `FitResult` instance.\n",
      "     |      \n",
      "     |      :arg height:\n",
      "     |          height of rect.\n",
      "     |      :arg width_min:\n",
      "     |          Minimum width to consider; must be >= 0.\n",
      "     |      :arg width_max:\n",
      "     |          Maximum width to consider, must be >= width_min or `None` for\n",
      "     |          infinite.\n",
      "     |      :arg origin:\n",
      "     |          `(x0, y0)` of rect.\n",
      "     |      :arg delta:\n",
      "     |          Maximum error in returned width.\n",
      "     |      :arg verbose:\n",
      "     |          If true we output diagnostics.\n",
      "     |  \n",
      "     |  place(self, where)\n",
      "     |  \n",
      "     |  reset(self)\n",
      "     |  \n",
      "     |  write(self, writer, rectfn, positionfn=None, pagefn=None)\n",
      "     |  \n",
      "     |  write_with_links(self, rectfn, positionfn=None, pagefn=None)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods defined here:\n",
      "     |  \n",
      "     |  add_pdf_links(document_or_stream, positions)\n",
      "     |      Adds links to PDF document.\n",
      "     |      Args:\n",
      "     |          document_or_stream:\n",
      "     |              A PDF `Document` or raw PDF content, for example an\n",
      "     |              `io.BytesIO` instance.\n",
      "     |          positions:\n",
      "     |              List of `ElementPosition`'s for `document_or_stream`,\n",
      "     |              typically from Story.element_positions(). We raise an\n",
      "     |              exception if two or more positions have same id.\n",
      "     |      Returns:\n",
      "     |          `document_or_stream` if a `Document` instance, otherwise a\n",
      "     |          new `Document` instance.\n",
      "     |      We raise an exception if an `href` in `positions` refers to an\n",
      "     |      internal position `#<name>` but no item in `postions` has `id =\n",
      "     |      name`.\n",
      "     |  \n",
      "     |  write_stabilized(writer, contentfn, rectfn, user_css=None, em=12, positionfn=None, pagefn=None, archive=None, add_header_ids=True)\n",
      "     |  \n",
      "     |  write_stabilized_with_links(contentfn, rectfn, user_css=None, em=12, positionfn=None, pagefn=None, archive=None, add_header_ids=True)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties defined here:\n",
      "     |  \n",
      "     |  body\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  FitResult = <class 'fitz.Story.FitResult'>\n",
      "     |      The result from a `Story.fit*()` method.\n",
      "     |      \n",
      "     |      Members:\n",
      "     |      \n",
      "     |      `big_enough`:\n",
      "     |          `True` if the fit succeeded.\n",
      "     |      `filled`:\n",
      "     |          From the last call to `Story.place()`.\n",
      "     |      `more`:\n",
      "     |          `False` if the fit succeeded.\n",
      "     |      `numcalls`:\n",
      "     |          Number of calls made to `self.place()`.\n",
      "     |      `parameter`:\n",
      "     |          The successful parameter value, or the largest failing value.\n",
      "     |      `rect`:\n",
      "     |          The rect created from `parameter`.\n",
      "    \n",
      "    class TOOLS(builtins.object)\n",
      "     |  We use @staticmethod to avoid the need to create an instance of this class.\n",
      "     |  \n",
      "     |  Static methods defined here:\n",
      "     |  \n",
      "     |  gen_id()\n",
      "     |  \n",
      "     |  glyph_cache_empty()\n",
      "     |      Empty the glyph cache.\n",
      "     |  \n",
      "     |  image_profile(stream, keep_image=0)\n",
      "     |      Metadata of an image binary stream.\n",
      "     |  \n",
      "     |  mupdf_display_errors(on=None)\n",
      "     |      Set MuPDF error display to True or False.\n",
      "     |  \n",
      "     |  mupdf_display_warnings(on=None)\n",
      "     |      Set MuPDF warnings display to True or False.\n",
      "     |  \n",
      "     |  mupdf_version()\n",
      "     |      Get version of MuPDF binary build.\n",
      "     |  \n",
      "     |  mupdf_warnings(reset=1)\n",
      "     |      Get the MuPDF warnings/errors with optional reset (default).\n",
      "     |  \n",
      "     |  reset_mupdf_warnings()\n",
      "     |  \n",
      "     |  set_aa_level(level)\n",
      "     |      Set anti-aliasing level.\n",
      "     |  \n",
      "     |  set_annot_stem(stem=None)\n",
      "     |  \n",
      "     |  set_font_width(doc, xref, width)\n",
      "     |  \n",
      "     |  set_graphics_min_line_width(min_line_width)\n",
      "     |      Set the graphics minimum line width.\n",
      "     |  \n",
      "     |  set_icc(on=0)\n",
      "     |      Set ICC color handling on or off.\n",
      "     |  \n",
      "     |  set_low_memory(on=None)\n",
      "     |      Set / unset MuPDF device caching.\n",
      "     |  \n",
      "     |  set_small_glyph_heights(on=None)\n",
      "     |      Set / unset small glyph heights.\n",
      "     |  \n",
      "     |  set_subset_fontnames(on=None)\n",
      "     |      Set / unset returning fontnames with their subset prefix.\n",
      "     |  \n",
      "     |  show_aa_level()\n",
      "     |      Show anti-aliasing values.\n",
      "     |  \n",
      "     |  store_maxsize()\n",
      "     |      MuPDF store size limit.\n",
      "     |  \n",
      "     |  store_shrink(percent)\n",
      "     |      Free 'percent' of current store size.\n",
      "     |  \n",
      "     |  store_size()\n",
      "     |      MuPDF current store size.\n",
      "     |  \n",
      "     |  unset_quad_corrections(on=None)\n",
      "     |      Set ascender / descender corrections on or off.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  JM_annot_id_stem = 'fitz'\n",
      "     |  \n",
      "     |  fitz_config = {'base14': True, 'cbz': True, 'epub': True, 'html': True...\n",
      "    \n",
      "    class TextPage(builtins.object)\n",
      "     |  TextPage(*args)\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, *args)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  extractBLOCKS(self)\n",
      "     |      Return a list with text block information.\n",
      "     |  \n",
      "     |  extractDICT(self, cb=None, sort=False) -> dict\n",
      "     |      Return page content as a Python dict of images and text spans.\n",
      "     |  \n",
      "     |  extractHTML(self) -> str\n",
      "     |      Return page content as a HTML string.\n",
      "     |  \n",
      "     |  extractIMGINFO(self, hashes=0)\n",
      "     |      Return a list with image meta information.\n",
      "     |  \n",
      "     |  extractJSON(self, cb=None, sort=False) -> str\n",
      "     |      Return 'extractDICT' converted to JSON format.\n",
      "     |  \n",
      "     |  extractRAWDICT(self, cb=None, sort=False) -> dict\n",
      "     |      Return page content as a Python dict of images and text characters.\n",
      "     |  \n",
      "     |  extractRAWJSON(self, cb=None, sort=False) -> str\n",
      "     |      Return 'extractRAWDICT' converted to JSON format.\n",
      "     |  \n",
      "     |  extractSelection(self, pointa, pointb)\n",
      "     |  \n",
      "     |  extractTEXT = extractText(self, sort=False) -> str\n",
      "     |  \n",
      "     |  extractText(self, sort=False) -> str\n",
      "     |      Return simple, bare text on the page.\n",
      "     |  \n",
      "     |  extractTextbox(self, rect)\n",
      "     |  \n",
      "     |  extractWORDS(self, delimiters=None)\n",
      "     |      Return a list with text word information.\n",
      "     |  \n",
      "     |  extractXHTML(self) -> str\n",
      "     |      Return page content as a XHTML string.\n",
      "     |  \n",
      "     |  extractXML(self) -> str\n",
      "     |      Return page content as a XML string.\n",
      "     |  \n",
      "     |  poolsize(self)\n",
      "     |      TextPage current poolsize.\n",
      "     |  \n",
      "     |  search(self, needle, hit_max=0, quads=1)\n",
      "     |      Locate 'needle' returning rects or quads.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties defined here:\n",
      "     |  \n",
      "     |  rect\n",
      "     |      Page rectangle.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class TextWriter(builtins.object)\n",
      "     |  TextWriter(page_rect, opacity=1, color=None)\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, page_rect, opacity=1, color=None)\n",
      "     |      Stores text spans for later output on compatible PDF pages.\n",
      "     |  \n",
      "     |  append(self, pos, text, font=None, fontsize=11, language=None, right_to_left=0, small_caps=0)\n",
      "     |      Store 'text' at point 'pos' using 'font' and 'fontsize'.\n",
      "     |  \n",
      "     |  appendv(self, pos, text, font=None, fontsize=11, language=None, small_caps=False)\n",
      "     |  \n",
      "     |  clean_rtl(self, text)\n",
      "     |      Revert the sequence of Latin text parts.\n",
      "     |      \n",
      "     |      Text with right-to-left writing direction (Arabic, Hebrew) often\n",
      "     |      contains Latin parts, which are written in left-to-right: numbers, names,\n",
      "     |      etc. For output as PDF text we need *everything* in right-to-left.\n",
      "     |      E.g. an input like \"<arabic> ABCDE FG HIJ <arabic> KL <arabic>\" will be\n",
      "     |      converted to \"<arabic> JIH GF EDCBA <arabic> LK <arabic>\". The Arabic\n",
      "     |      parts remain untouched.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          text: str\n",
      "     |      Returns:\n",
      "     |          Massaged string.\n",
      "     |  \n",
      "     |  fill_textbox(writer: fitz.TextWriter, rect: 'rect_like', text: Union[str, list], pos: 'point_like' = None, font: Optional[fitz.Font] = None, fontsize: float = 11, lineheight: Optional[float] = None, align: int = 0, warn: bool = None, right_to_left: bool = False, small_caps: bool = False) -> tuple\n",
      "     |      Fill a rectangle with text.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          writer: fitz.TextWriter object (= \"self\")\n",
      "     |          rect: rect-like to receive the text.\n",
      "     |          text: string or list/tuple of strings.\n",
      "     |          pos: point-like start position of first word.\n",
      "     |          font: fitz.Font object (default fitz.Font('helv')).\n",
      "     |          fontsize: the fontsize.\n",
      "     |          lineheight: overwrite the font property\n",
      "     |          align: (int) 0 = left, 1 = center, 2 = right, 3 = justify\n",
      "     |          warn: (bool) text overflow action: none, warn, or exception\n",
      "     |          right_to_left: (bool) indicate right-to-left language.\n",
      "     |  \n",
      "     |  write_text(self, page, color=None, opacity=-1, overlay=1, morph=None, matrix=None, render_mode=0, oc=0)\n",
      "     |      Write the text to a PDF page having the TextWriter's page size.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          page: a PDF page having same size.\n",
      "     |          color: override text color.\n",
      "     |          opacity: override transparency.\n",
      "     |          overlay: put in foreground or background.\n",
      "     |          morph: tuple(Point, Matrix), apply a matrix with a fixpoint.\n",
      "     |          matrix: Matrix to be used instead of 'morph' argument.\n",
      "     |          render_mode: (int) PDF render mode operator 'Tr'.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class Walker(fitz.mupdf.FzPathWalker2)\n",
      "     |  Walker(dev)\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      Walker\n",
      "     |      fitz.mupdf.FzPathWalker2\n",
      "     |      fitz.mupdf.FzPathWalker\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, dev)\n",
      "     |      == Constructor.\n",
      "     |  \n",
      "     |  closepath(self, ctx)\n",
      "     |  \n",
      "     |  curveto(self, ctx, x1, y1, x2, y2, x3, y3)\n",
      "     |  \n",
      "     |  lineto(self, ctx, x, y)\n",
      "     |  \n",
      "     |  moveto(self, ctx, x, y)\n",
      "     |      Default virtual method implementations; these all throw an exception.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from fitz.mupdf.FzPathWalker2:\n",
      "     |  \n",
      "     |  __disown__(self)\n",
      "     |  \n",
      "     |  __repr__ = _swig_repr(self)\n",
      "     |  \n",
      "     |  curvetov(self, arg_0, arg_2, arg_3, arg_4, arg_5)\n",
      "     |  \n",
      "     |  curvetoy(self, arg_0, arg_2, arg_3, arg_4, arg_5)\n",
      "     |  \n",
      "     |  quadto(self, arg_0, arg_2, arg_3, arg_4, arg_5)\n",
      "     |  \n",
      "     |  rectto(self, arg_0, arg_2, arg_3, arg_4, arg_5)\n",
      "     |  \n",
      "     |  use_virtual_closepath(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_curveto(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_curvetov(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_curvetoy(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_lineto(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_moveto(self, use=True)\n",
      "     |      These methods set the function pointers in *m_internal\n",
      "     |      to point to internal callbacks that call our virtual methods.\n",
      "     |  \n",
      "     |  use_virtual_quadto(self, use=True)\n",
      "     |  \n",
      "     |  use_virtual_rectto(self, use=True)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods inherited from fitz.mupdf.FzPathWalker2:\n",
      "     |  \n",
      "     |  __swig_destroy__ = delete_FzPathWalker2(...)\n",
      "     |      == Destructor.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from fitz.mupdf.FzPathWalker2:\n",
      "     |  \n",
      "     |  thisown\n",
      "     |      The membership flag\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from fitz.mupdf.FzPathWalker:\n",
      "     |  \n",
      "     |  m_internal_value(self)\n",
      "     |      Return numerical value of .m_internal; helps with Python debugging.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from fitz.mupdf.FzPathWalker:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  m_internal\n",
      "     |      Pointer to wrapped data.\n",
      "     |  \n",
      "     |  s_num_instances\n",
      "    \n",
      "    class Widget(builtins.object)\n",
      "     |  Class describing a PDF form field (\"widget\")\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  __repr__(self)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  button_states(self)\n",
      "     |      Return the on/off state names for button widgets.\n",
      "     |      \n",
      "     |      A button may have 'normal' or 'pressed down' appearances. While the 'Off'\n",
      "     |      state is usually called like this, the 'On' state is often given a name\n",
      "     |      relating to the functional context.\n",
      "     |  \n",
      "     |  on_state(self)\n",
      "     |      Return the \"On\" value for button widgets.\n",
      "     |      \n",
      "     |      This is useful for radio buttons mainly. Checkboxes will always return\n",
      "     |      \"Yes\". Radio buttons will return the string that is unequal to \"Off\"\n",
      "     |      as returned by method button_states().\n",
      "     |      If the radio button is new / being created, it does not yet have an\n",
      "     |      \"On\" value. In this case, a warning is shown and True is returned.\n",
      "     |  \n",
      "     |  reset(self)\n",
      "     |      Reset the field value to its default.\n",
      "     |  \n",
      "     |  update(self)\n",
      "     |      Reflect Python object in the PDF.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties defined here:\n",
      "     |  \n",
      "     |  next\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class Xml(builtins.object)\n",
      "     |  Xml(rhs)\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __enter__(self)\n",
      "     |  \n",
      "     |  __exit__(self, *args)\n",
      "     |  \n",
      "     |  __init__(self, rhs)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  add_bullet_list(self)\n",
      "     |      Add bulleted list (\"ul\" tag)\n",
      "     |  \n",
      "     |  add_class(self, text)\n",
      "     |      Set some class via CSS. Replaces complete class spec.\n",
      "     |  \n",
      "     |  add_code(self, text=None)\n",
      "     |      Add a \"code\" tag\n",
      "     |  \n",
      "     |  add_codeblock(self)\n",
      "     |      Add monospaced lines (\"pre\" node)\n",
      "     |  \n",
      "     |  add_description_list(self)\n",
      "     |      Add description list (\"dl\" tag)\n",
      "     |  \n",
      "     |  add_division(self)\n",
      "     |      Add \"div\" tag\n",
      "     |  \n",
      "     |  add_header(self, level=1)\n",
      "     |      Add header tag\n",
      "     |  \n",
      "     |  add_horizontal_line(self)\n",
      "     |      Add horizontal line (\"hr\" tag)\n",
      "     |  \n",
      "     |  add_image(self, name, width=None, height=None, imgfloat=None, align=None)\n",
      "     |      Add image node (tag \"img\").\n",
      "     |  \n",
      "     |  add_kbd = add_code(self, text=None)\n",
      "     |  \n",
      "     |  add_link(self, href, text=None)\n",
      "     |      Add a hyperlink (\"a\" tag)\n",
      "     |  \n",
      "     |  add_list_item(self)\n",
      "     |      Add item (\"li\" tag) under a (numbered or bulleted) list.\n",
      "     |  \n",
      "     |  add_number_list(self, start=1, numtype=None)\n",
      "     |      Add numbered list (\"ol\" tag)\n",
      "     |  \n",
      "     |  add_paragraph(self)\n",
      "     |      Add \"p\" tag\n",
      "     |  \n",
      "     |  add_samp = add_code(self, text=None)\n",
      "     |  \n",
      "     |  add_span(self)\n",
      "     |  \n",
      "     |  add_style(self, text)\n",
      "     |      Set some style via CSS style. Replaces complete style spec.\n",
      "     |  \n",
      "     |  add_subscript(self, text=None)\n",
      "     |      Add a subscript (\"sub\" tag)\n",
      "     |  \n",
      "     |  add_superscript(self, text=None)\n",
      "     |      Add a superscript (\"sup\" tag)\n",
      "     |  \n",
      "     |  add_text(self, text)\n",
      "     |      Add text. Line breaks are honored.\n",
      "     |  \n",
      "     |  add_var = add_code(self, text=None)\n",
      "     |  \n",
      "     |  append_child(self, child)\n",
      "     |  \n",
      "     |  append_styled_span(self, style)\n",
      "     |  \n",
      "     |  bodytag(self)\n",
      "     |  \n",
      "     |  clone(self)\n",
      "     |  \n",
      "     |  create_element(self, tag)\n",
      "     |  \n",
      "     |  create_text_node(self, text)\n",
      "     |  \n",
      "     |  debug(self)\n",
      "     |      Print a list of the node tree below self.\n",
      "     |  \n",
      "     |  find(self, tag, att, match)\n",
      "     |  \n",
      "     |  find_next(self, tag, att, match)\n",
      "     |  \n",
      "     |  get_attribute_value(self, key)\n",
      "     |  \n",
      "     |  get_attributes(self)\n",
      "     |  \n",
      "     |  insert_after(self, node)\n",
      "     |  \n",
      "     |  insert_before(self, node)\n",
      "     |  \n",
      "     |  insert_text(self, text)\n",
      "     |  \n",
      "     |  remove(self)\n",
      "     |  \n",
      "     |  remove_attribute(self, key)\n",
      "     |  \n",
      "     |  set_align(self, align)\n",
      "     |      Set text alignment via CSS style\n",
      "     |  \n",
      "     |  set_attribute(self, key, value)\n",
      "     |  \n",
      "     |  set_bgcolor(self, color)\n",
      "     |      Set background color via CSS style\n",
      "     |  \n",
      "     |  set_bold(self, val=True)\n",
      "     |      Set bold on / off via CSS style\n",
      "     |  \n",
      "     |  set_color(self, color)\n",
      "     |      Set text color via CSS style\n",
      "     |  \n",
      "     |  set_columns(self, cols)\n",
      "     |      Set number of text columns via CSS style\n",
      "     |  \n",
      "     |  set_font(self, font)\n",
      "     |      Set font-family name via CSS style\n",
      "     |  \n",
      "     |  set_fontsize(self, fontsize)\n",
      "     |      Set font size name via CSS style\n",
      "     |  \n",
      "     |  set_id(self, unique)\n",
      "     |      Set a unique id.\n",
      "     |  \n",
      "     |  set_italic(self, val=True)\n",
      "     |      Set italic on / off via CSS style\n",
      "     |  \n",
      "     |  set_leading(self, leading)\n",
      "     |      Set inter-line spacing value via CSS style - block-level only.\n",
      "     |  \n",
      "     |  set_letter_spacing(self, spacing)\n",
      "     |      Set inter-letter spacing value via CSS style\n",
      "     |  \n",
      "     |  set_lineheight(self, lineheight)\n",
      "     |      Set line height name via CSS style - block-level only.\n",
      "     |  \n",
      "     |  set_margins(self, val)\n",
      "     |      Set margin values via CSS style\n",
      "     |  \n",
      "     |  set_opacity(self, opacity)\n",
      "     |      Set opacity via CSS style\n",
      "     |  \n",
      "     |  set_pagebreak_after(self)\n",
      "     |      Insert a page break after this node.\n",
      "     |  \n",
      "     |  set_pagebreak_before(self)\n",
      "     |      Insert a page break before this node.\n",
      "     |  \n",
      "     |  set_properties(self, align=None, bgcolor=None, bold=None, color=None, columns=None, font=None, fontsize=None, indent=None, italic=None, leading=None, letter_spacing=None, lineheight=None, margins=None, pagebreak_after=None, pagebreak_before=None, word_spacing=None, unqid=None, cls=None)\n",
      "     |      Set any or all properties of a node.\n",
      "     |      \n",
      "     |      To be used for existing nodes preferrably.\n",
      "     |  \n",
      "     |  set_text_indent(self, indent)\n",
      "     |      Set text indentation name via CSS style - block-level only.\n",
      "     |  \n",
      "     |  set_underline(self, val='underline')\n",
      "     |  \n",
      "     |  set_word_spacing(self, spacing)\n",
      "     |      Set inter-word spacing value via CSS style\n",
      "     |  \n",
      "     |  span_bottom(self)\n",
      "     |      Find deepest level in stacked spans.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods defined here:\n",
      "     |  \n",
      "     |  color_text(color)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties defined here:\n",
      "     |  \n",
      "     |  first_child\n",
      "     |  \n",
      "     |  is_text\n",
      "     |      Check if this is a text node.\n",
      "     |  \n",
      "     |  last_child\n",
      "     |      Return last child node.\n",
      "     |  \n",
      "     |  next\n",
      "     |  \n",
      "     |  parent\n",
      "     |  \n",
      "     |  previous\n",
      "     |  \n",
      "     |  root\n",
      "     |  \n",
      "     |  tagname\n",
      "     |  \n",
      "     |  text\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class linkDest(builtins.object)\n",
      "     |  linkDest(obj, rlink, document=None)\n",
      "     |  \n",
      "     |  link or outline destination details\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, obj, rlink, document=None)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    open = class Document(builtins.object)\n",
      "     |  open(filename=None, stream=None, filetype=None, rect=None, width=0, height=0, fontsize=11)\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __contains__(self, loc) -> bool\n",
      "     |  \n",
      "     |  __delitem__(self, i) -> None\n",
      "     |  \n",
      "     |  __enter__(self)\n",
      "     |  \n",
      "     |  __exit__(self, *args)\n",
      "     |  \n",
      "     |  __getitem__(self, i: int = 0)\n",
      "     |  \n",
      "     |  __init__(self, filename=None, stream=None, filetype=None, rect=None, width=0, height=0, fontsize=11)\n",
      "     |      Creates a document. Use 'open' as a synonym.\n",
      "     |      \n",
      "     |      Notes:\n",
      "     |          Basic usages:\n",
      "     |          open() - new PDF document\n",
      "     |          open(filename) - string or pathlib.Path, must have supported\n",
      "     |                  file extension.\n",
      "     |          open(type, buffer) - type: valid extension, buffer: bytes object.\n",
      "     |          open(stream=buffer, filetype=type) - keyword version of previous.\n",
      "     |          open(filename, fileype=type) - filename with unrecognized extension.\n",
      "     |          rect, width, height, fontsize: layout reflowable document\n",
      "     |          on open (e.g. EPUB). Ignored if n/a.\n",
      "     |  \n",
      "     |  __len__(self) -> int\n",
      "     |  \n",
      "     |  __repr__(self) -> str\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  add_layer(self, name, creator=None, on=None)\n",
      "     |      Add a new OC layer.\n",
      "     |  \n",
      "     |  add_ocg(self, name, config=-1, on=1, intent=None, usage=None)\n",
      "     |      Add new optional content group.\n",
      "     |  \n",
      "     |  authenticate(self, password)\n",
      "     |      Decrypt document.\n",
      "     |  \n",
      "     |  can_save_incrementally(self)\n",
      "     |      Check whether incremental saves are possible.\n",
      "     |  \n",
      "     |  chapter_page_count(self, chapter)\n",
      "     |      Page count of chapter.\n",
      "     |  \n",
      "     |  close(self)\n",
      "     |      Close document.\n",
      "     |  \n",
      "     |  convert_to_pdf(self, from_page=0, to_page=-1, rotate=0)\n",
      "     |      Convert document to a PDF, selecting page range and optional rotation. Output bytes object.\n",
      "     |  \n",
      "     |  copy_page(self, pno: int, to: int = -1)\n",
      "     |      Copy a page within a PDF document.\n",
      "     |      \n",
      "     |      This will only create another reference of the same page object.\n",
      "     |      Args:\n",
      "     |          pno: source page number\n",
      "     |          to: put before this page, '-1' means after last page.\n",
      "     |  \n",
      "     |  del_toc_item(doc: fitz.Document, idx: int) -> None\n",
      "     |      Delete TOC / bookmark item by index.\n",
      "     |  \n",
      "     |  del_xml_metadata(self)\n",
      "     |      Delete XML metadata.\n",
      "     |  \n",
      "     |  delete_page(self, pno: int = -1)\n",
      "     |      Delete one page from a PDF.\n",
      "     |  \n",
      "     |  delete_pages(self, *args, **kw)\n",
      "     |      Delete pages from a PDF.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          Either keywords 'from_page'/'to_page', or two integers to\n",
      "     |          specify the first/last page to delete.\n",
      "     |          Or a list/tuple/range object, which can contain arbitrary\n",
      "     |          page numbers.\n",
      "     |  \n",
      "     |  embfile_add(self, name: str, buffer_: ByteString, filename: Optional[str] = None, ufilename: Optional[str] = None, desc: Optional[str] = None) -> None\n",
      "     |      Add an item to the EmbeddedFiles array.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          name: name of the new item, must not already exist.\n",
      "     |          buffer_: (binary data) the file content.\n",
      "     |          filename: (str) the file name, default: the name\n",
      "     |          ufilename: (unicode) the file name, default: filename\n",
      "     |          desc: (str) the description.\n",
      "     |  \n",
      "     |  embfile_count(self) -> int\n",
      "     |      Get number of EmbeddedFiles.\n",
      "     |  \n",
      "     |  embfile_del(self, item: Union[int, str])\n",
      "     |      Delete an entry from EmbeddedFiles.\n",
      "     |      \n",
      "     |      Notes:\n",
      "     |          The argument must be name or index of an EmbeddedFiles item.\n",
      "     |          Physical deletion of data will happen on save to a new\n",
      "     |          file with appropriate garbage option.\n",
      "     |      Args:\n",
      "     |          item: name or number of item.\n",
      "     |      Returns:\n",
      "     |          None\n",
      "     |  \n",
      "     |  embfile_get(self, item: Union[int, str]) -> bytes\n",
      "     |      Get the content of an item in the EmbeddedFiles array.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          item: number or name of item.\n",
      "     |      Returns:\n",
      "     |          (bytes) The file content.\n",
      "     |  \n",
      "     |  embfile_info(self, item: Union[int, str]) -> dict\n",
      "     |      Get information of an item in the EmbeddedFiles array.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          item: number or name of item.\n",
      "     |      Returns:\n",
      "     |          Information dictionary.\n",
      "     |  \n",
      "     |  embfile_names(self) -> list\n",
      "     |      Get list of names of EmbeddedFiles.\n",
      "     |  \n",
      "     |  embfile_upd(self, item: Union[int, str], buffer_: Optional[ByteString] = None, filename: Optional[str] = None, ufilename: Optional[str] = None, desc: Optional[str] = None) -> None\n",
      "     |      Change an item of the EmbeddedFiles array.\n",
      "     |      \n",
      "     |      Notes:\n",
      "     |          Only provided parameters are changed. If all are omitted,\n",
      "     |          the method is a no-op.\n",
      "     |      Args:\n",
      "     |          item: number or name of item.\n",
      "     |          buffer_: (binary data) the new file content.\n",
      "     |          filename: (str) the new file name.\n",
      "     |          ufilename: (unicode) the new filen ame.\n",
      "     |          desc: (str) the new description.\n",
      "     |  \n",
      "     |  extract_font(self, xref=0, info_only=0, named=None)\n",
      "     |      Get a font by xref. Returns a tuple or dictionary.\n",
      "     |  \n",
      "     |  extract_image(self, xref)\n",
      "     |      Get image by xref. Returns a dictionary.\n",
      "     |  \n",
      "     |  ez_save(self, filename, garbage=3, clean=False, deflate=True, deflate_images=True, deflate_fonts=True, incremental=False, ascii=False, expand=False, linear=False, pretty=False, encryption=1, permissions=4095, owner_pw=None, user_pw=None, no_new_id=True, preserve_metadata=1, use_objstms=1, compression_effort=0)\n",
      "     |      Save PDF using some different defaults\n",
      "     |  \n",
      "     |  find_bookmark(self, bm)\n",
      "     |      Find new location after layouting a document.\n",
      "     |  \n",
      "     |  fullcopy_page(self, pno, to=-1)\n",
      "     |      Make a full page duplicate.\n",
      "     |  \n",
      "     |  get_char_widths(doc: fitz.Document, xref: int, limit: int = 256, idx: int = 0, fontdict: Optional[dict] = None) -> list\n",
      "     |      Get list of glyph information of a font.\n",
      "     |      \n",
      "     |      Notes:\n",
      "     |          Must be provided by its XREF number. If we already dealt with the\n",
      "     |          font, it will be recorded in doc.FontInfos. Otherwise we insert an\n",
      "     |          entry there.\n",
      "     |          Finally we return the glyphs for the font. This is a list of\n",
      "     |          (glyph, width) where glyph is an integer controlling the char\n",
      "     |          appearance, and width is a float controlling the char's spacing:\n",
      "     |          width * fontsize is the actual space.\n",
      "     |          For 'simple' fonts, glyph == ord(char) will usually be true.\n",
      "     |          Exceptions are 'Symbol' and 'ZapfDingbats'. We are providing data for these directly here.\n",
      "     |  \n",
      "     |  get_layer(self, config=-1)\n",
      "     |      Content of ON, OFF, RBGroups of an OC layer.\n",
      "     |  \n",
      "     |  get_layers(self)\n",
      "     |      Show optional OC layers.\n",
      "     |  \n",
      "     |  get_new_xref(self)\n",
      "     |      Make new xref.\n",
      "     |  \n",
      "     |  get_oc(doc: fitz.Document, xref: int) -> int\n",
      "     |      Return optional content object xref for an image or form xobject.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          xref: (int) xref number of an image or form xobject.\n",
      "     |  \n",
      "     |  get_ocgs(self)\n",
      "     |      Show existing optional content groups.\n",
      "     |  \n",
      "     |  get_ocmd(doc: fitz.Document, xref: int) -> dict\n",
      "     |      Return the definition of an OCMD (optional content membership dictionary).\n",
      "     |      \n",
      "     |      Recognizes PDF dict keys /OCGs (PDF array of OCGs), /P (policy string) and\n",
      "     |      /VE (visibility expression, PDF array). Via string manipulation, this\n",
      "     |      info is converted to a Python dictionary with keys \"xref\", \"ocgs\", \"policy\"\n",
      "     |      and \"ve\" - ready to recycle as input for 'set_ocmd()'.\n",
      "     |  \n",
      "     |  get_outline_xrefs(self)\n",
      "     |      Get list of outline xref numbers.\n",
      "     |  \n",
      "     |  get_page_fonts(self, pno: int, full: bool = False) -> list\n",
      "     |      Retrieve a list of fonts used on a page.\n",
      "     |  \n",
      "     |  get_page_images(self, pno: int, full: bool = False) -> list\n",
      "     |      Retrieve a list of images used on a page.\n",
      "     |  \n",
      "     |  get_page_labels(doc)\n",
      "     |      Return page label definitions in PDF document.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          doc: PDF document (resp. 'self').\n",
      "     |      Returns:\n",
      "     |          A list of dictionaries with the following format:\n",
      "     |          {'startpage': int, 'prefix': str, 'style': str, 'firstpagenum': int}.\n",
      "     |  \n",
      "     |  get_page_numbers(doc, label, only_one=False)\n",
      "     |      Return a list of page numbers with the given label.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          doc: PDF document object (resp. 'self').\n",
      "     |          label: (str) label.\n",
      "     |          only_one: (bool) stop searching after first hit.\n",
      "     |      Returns:\n",
      "     |          List of page numbers having this label.\n",
      "     |  \n",
      "     |  get_page_pixmap(doc: fitz.Document, pno: int, *, matrix: 'matrix_like' = IdentityMatrix(1.0, 0.0, 0.0, 1.0, 0.0, 0.0), dpi=None, colorspace: fitz.Colorspace = Colorspace(CS_RGB) - DeviceRGB, clip: 'rect_like' = None, alpha: bool = False, annots: bool = True) -> fitz.Pixmap\n",
      "     |      Create pixmap of document page by page number.\n",
      "     |      \n",
      "     |      Notes:\n",
      "     |          Convenience function calling page.get_pixmap.\n",
      "     |      Args:\n",
      "     |          pno: (int) page number\n",
      "     |          matrix: fitz.Matrix for transformation (default: fitz.Identity).\n",
      "     |          colorspace: (str,fitz.Colorspace) rgb, rgb, gray - case ignored, default csRGB.\n",
      "     |          clip: (irect-like) restrict rendering to this area.\n",
      "     |          alpha: (bool) include alpha channel\n",
      "     |          annots: (bool) also render annotations\n",
      "     |  \n",
      "     |  get_page_text(doc: fitz.Document, pno: int, option: str = 'text', clip: 'rect_like' = None, flags: Optional[int] = None, textpage: fitz.TextPage = None, sort: bool = False) -> Any\n",
      "     |      Extract a document page's text by page number.\n",
      "     |      \n",
      "     |      Notes:\n",
      "     |          Convenience function calling page.get_text().\n",
      "     |      Args:\n",
      "     |          pno: page number\n",
      "     |          option: (str) text, words, blocks, html, dict, json, rawdict, xhtml or xml.\n",
      "     |      Returns:\n",
      "     |          output from page.TextPage().\n",
      "     |  \n",
      "     |  get_page_xobjects(self, pno: int) -> list\n",
      "     |      Retrieve a list of XObjects used on a page.\n",
      "     |  \n",
      "     |  get_sigflags(self)\n",
      "     |      Get the /SigFlags value.\n",
      "     |  \n",
      "     |  get_toc(doc: fitz.Document, simple: bool = True) -> list\n",
      "     |      Create a table of contents.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          simple: a bool to control output. Returns a list, where each entry consists of outline level, title, page number and link destination (if simple = False). For details see PyMuPDF's documentation.\n",
      "     |  \n",
      "     |  get_xml_metadata(self)\n",
      "     |      Get document XML metadata.\n",
      "     |  \n",
      "     |  has_annots(doc: fitz.Document) -> bool\n",
      "     |      Check whether there are annotations on any page.\n",
      "     |  \n",
      "     |  has_links(doc: fitz.Document) -> bool\n",
      "     |      Check whether there are links on any page.\n",
      "     |  \n",
      "     |  init_doc(self)\n",
      "     |  \n",
      "     |  insert_file(self, infile, from_page=-1, to_page=-1, start_at=-1, rotate=-1, links=True, annots=True, show_progress=0, final=1)\n",
      "     |      Insert an arbitrary supported document to an existing PDF.\n",
      "     |      \n",
      "     |      The infile may be given as a filename, a Document or a Pixmap.\n",
      "     |      Other paramters - where applicable - equal those of insert_pdf().\n",
      "     |  \n",
      "     |  insert_page(doc: fitz.Document, pno: int, text: Union[str, list, NoneType] = None, fontsize: float = 11, width: float = 595, height: float = 842, fontname: str = 'helv', fontfile: Optional[str] = None, color: Optional[Sequence] = (0,)) -> int\n",
      "     |      Create a new PDF page and insert some text.\n",
      "     |      \n",
      "     |      Notes:\n",
      "     |          Function combining fitz.Document.new_page() and fitz.Page.insert_text().\n",
      "     |          For parameter details see these methods.\n",
      "     |  \n",
      "     |  insert_pdf(self, docsrc, from_page=-1, to_page=-1, start_at=-1, rotate=-1, links=1, annots=1, show_progress=0, final=1, _gmap=None)\n",
      "     |      Insert a page range from another PDF.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          docsrc: PDF to copy from. Must be different object, but may be same file.\n",
      "     |          from_page: (int) first source page to copy, 0-based, default 0.\n",
      "     |          to_page: (int) last source page to copy, 0-based, default last page.\n",
      "     |          start_at: (int) from_page will become this page number in target.\n",
      "     |          rotate: (int) rotate copied pages, default -1 is no change.\n",
      "     |          links: (int/bool) whether to also copy links.\n",
      "     |          annots: (int/bool) whether to also copy annotations.\n",
      "     |          show_progress: (int) progress message interval, 0 is no messages.\n",
      "     |          final: (bool) indicates last insertion from this source PDF.\n",
      "     |          _gmap: internal use only\n",
      "     |      \n",
      "     |      Copy sequence reversed if from_page > to_page.\n",
      "     |  \n",
      "     |  is_stream = xref_is_stream(self, xref=0)\n",
      "     |  \n",
      "     |  journal_can_do(self)\n",
      "     |      Show if undo and / or redo are possible.\n",
      "     |  \n",
      "     |  journal_enable(self)\n",
      "     |      Activate document journalling.\n",
      "     |  \n",
      "     |  journal_is_enabled(self)\n",
      "     |      Check if journalling is enabled.\n",
      "     |  \n",
      "     |  journal_load(self, filename)\n",
      "     |      Load a journal from a file.\n",
      "     |  \n",
      "     |  journal_op_name(self, step)\n",
      "     |      Show operation name for given step.\n",
      "     |  \n",
      "     |  journal_position(self)\n",
      "     |      Show journalling state.\n",
      "     |  \n",
      "     |  journal_redo(self)\n",
      "     |      Move forward in the journal.\n",
      "     |  \n",
      "     |  journal_save(self, filename)\n",
      "     |      Save journal to a file.\n",
      "     |  \n",
      "     |  journal_start_op(self, name=None)\n",
      "     |      Begin a journalling operation.\n",
      "     |  \n",
      "     |  journal_stop_op(self)\n",
      "     |      End a journalling operation.\n",
      "     |  \n",
      "     |  journal_undo(self)\n",
      "     |      Move backwards in the journal.\n",
      "     |  \n",
      "     |  layer_ui_configs(self)\n",
      "     |      Show OC visibility status modifiable by user.\n",
      "     |  \n",
      "     |  layout(self, rect=None, width=0, height=0, fontsize=11)\n",
      "     |      Re-layout a reflowable document.\n",
      "     |  \n",
      "     |  load_page(self, page_id)\n",
      "     |      Load a page.\n",
      "     |      \n",
      "     |      'page_id' is either a 0-based page number or a tuple (chapter, pno),\n",
      "     |      with chapter number and page number within that chapter.\n",
      "     |  \n",
      "     |  location_from_page_number(self, pno)\n",
      "     |      Convert pno to (chapter, page).\n",
      "     |  \n",
      "     |  make_bookmark(self, loc)\n",
      "     |      Make a page pointer before layouting document.\n",
      "     |  \n",
      "     |  move_page(self, pno: int, to: int = -1)\n",
      "     |      Move a page within a PDF document.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          pno: source page number.\n",
      "     |          to: put before this page, '-1' means after last page.\n",
      "     |  \n",
      "     |  need_appearances(self, value=None)\n",
      "     |      Get/set the NeedAppearances value.\n",
      "     |  \n",
      "     |  new_page(doc: fitz.Document, pno: int = -1, width: float = 595, height: float = 842) -> fitz.Page\n",
      "     |      Create and return a new page object.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          pno: (int) insert before this page. Default: after last page.\n",
      "     |          width: (float) page width in points. Default: 595 (ISO A4 width).\n",
      "     |          height: (float) page height in points. Default 842 (ISO A4 height).\n",
      "     |      Returns:\n",
      "     |          A fitz.Page object.\n",
      "     |  \n",
      "     |  next_location(self, page_id)\n",
      "     |      Get (chapter, page) of next page.\n",
      "     |  \n",
      "     |  page_annot_xrefs(self, n)\n",
      "     |  \n",
      "     |  page_cropbox(self, pno)\n",
      "     |      Get CropBox of page number (without loading page).\n",
      "     |  \n",
      "     |  page_number_from_location(self, page_id)\n",
      "     |      Convert (chapter, pno) to page number.\n",
      "     |  \n",
      "     |  page_xref(self, pno)\n",
      "     |      Get xref of page number.\n",
      "     |  \n",
      "     |  pages(self, start: Optional[int] = None, stop: Optional[int] = None, step: Optional[int] = None) -> 'Page_forward_decl'\n",
      "     |      Return a generator iterator over a page range.\n",
      "     |      \n",
      "     |      Arguments have the same meaning as for the range() built-in.\n",
      "     |  \n",
      "     |  pdf_catalog(self)\n",
      "     |      Get xref of PDF catalog.\n",
      "     |  \n",
      "     |  pdf_trailer(self, compressed=0, ascii=0)\n",
      "     |      Get PDF trailer as a string.\n",
      "     |  \n",
      "     |  prev_location(self, page_id)\n",
      "     |      Get (chapter, page) of previous page.\n",
      "     |  \n",
      "     |  reload_page(self, page: 'Page_forward_decl') -> 'Page_forward_decl'\n",
      "     |      Make a fresh copy of a page.\n",
      "     |  \n",
      "     |  resolve_link(self, uri=None, chapters=0)\n",
      "     |      Calculate internal link destination.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          uri: (str) some Link.uri\n",
      "     |          chapters: (bool) whether to use (chapter, page) format\n",
      "     |      Returns:\n",
      "     |          (page_id, x, y) where x, y are point coordinates on the page.\n",
      "     |          page_id is either page number (if chapters=0), or (chapter, pno).\n",
      "     |  \n",
      "     |  resolve_names(self)\n",
      "     |      Convert the PDF's destination names into a Python dict.\n",
      "     |      \n",
      "     |      This function must be used with PyMuPDF's new, \"rebased\" architecture -\n",
      "     |      see the above import statement.\n",
      "     |      \n",
      "     |      The only parameter is the fitz.Document.\n",
      "     |      All names found in the catalog under keys \"/Dests\" and \"/Names/Dests\" are\n",
      "     |      being included.\n",
      "     |      \n",
      "     |      Returns:\n",
      "     |          A dcitionary with the following layout:\n",
      "     |          - key: (str) the name\n",
      "     |          - value: (dict) with the following layout:\n",
      "     |              * \"page\":  target page number (0-based). If no page number found -1.\n",
      "     |              * \"to\": (x, y) target point on page - currently in PDF coordinates,\n",
      "     |                      i.e. point (0,0) is the bottom-left of the page.\n",
      "     |              * \"zoom\": (float) the zoom factor\n",
      "     |              * \"dest\": (str) only occurs if the target location on the page has\n",
      "     |                      not been provided as \"/XYZ\" or if no page number was found.\n",
      "     |          Examples:\n",
      "     |          {'__bookmark_1': {'page': 0, 'to': (0.0, 541.0), 'zoom': 0.0},\n",
      "     |          '__bookmark_2': {'page': 0, 'to': (0.0, 481.45), 'zoom': 0.0}}\n",
      "     |      \n",
      "     |          or\n",
      "     |      \n",
      "     |          '21154a7c20684ceb91f9c9adc3b677c40': {'page': -1, 'dest': '/XYZ 15.75 1486 0'}, ...\n",
      "     |  \n",
      "     |  save(self, filename, garbage=0, clean=0, deflate=0, deflate_images=0, deflate_fonts=0, incremental=0, ascii=0, expand=0, linear=0, no_new_id=0, appearance=0, pretty=0, encryption=1, permissions=4095, owner_pw=None, user_pw=None, preserve_metadata=1, use_objstms=0, compression_effort=0)\n",
      "     |      Save PDF to file, pathlib.Path or file pointer.\n",
      "     |  \n",
      "     |  saveIncr(self)\n",
      "     |      Save PDF incrementally\n",
      "     |  \n",
      "     |  save_snapshot(self, filename)\n",
      "     |      Save a file snapshot suitable for journalling.\n",
      "     |  \n",
      "     |  scrub(doc: fitz.Document, attached_files: bool = True, clean_pages: bool = True, embedded_files: bool = True, hidden_text: bool = True, javascript: bool = True, metadata: bool = True, redactions: bool = True, redact_images: int = 0, remove_links: bool = True, reset_fields: bool = True, reset_responses: bool = True, thumbnails: bool = True, xml_metadata: bool = True) -> None\n",
      "     |      # ------------------------------------------------------------------------------\n",
      "     |      # Remove potentially sensitive data from a PDF. Similar to the Adobe\n",
      "     |      # Acrobat 'sanitize' function\n",
      "     |      # ------------------------------------------------------------------------------\n",
      "     |  \n",
      "     |  search_page_for(doc: fitz.Document, pno: int, text: str, quads: bool = False, clip: 'rect_like' = None, flags: int = 83, textpage: fitz.TextPage = None) -> list\n",
      "     |      Search for a string on a page.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          pno: page number\n",
      "     |          text: string to be searched for\n",
      "     |          clip: restrict search to this rectangle\n",
      "     |          quads: (bool) return quads instead of rectangles\n",
      "     |          flags: bit switches, default: join hyphened words\n",
      "     |          textpage: reuse a prepared textpage\n",
      "     |      Returns:\n",
      "     |          a list of rectangles or quads, each containing an occurrence.\n",
      "     |  \n",
      "     |  select(self, pyliste)\n",
      "     |      Build sub-pdf with page numbers in the list.\n",
      "     |  \n",
      "     |  set_language(self, language=None)\n",
      "     |  \n",
      "     |  set_layer(self, config, basestate=None, on=None, off=None, rbgroups=None, locked=None)\n",
      "     |      Set the PDF keys /ON, /OFF, /RBGroups of an OC layer.\n",
      "     |  \n",
      "     |  set_layer_ui_config(self, number, action=0)\n",
      "     |      Set / unset OC intent configuration.\n",
      "     |  \n",
      "     |  set_markinfo(self, markinfo: dict) -> bool\n",
      "     |      Set the PDF MarkInfo values.\n",
      "     |  \n",
      "     |  set_metadata(doc: fitz.Document, m: dict) -> None\n",
      "     |      Update the PDF /Info object.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          m: a dictionary like doc.metadata.\n",
      "     |  \n",
      "     |  set_oc(doc: fitz.Document, xref: int, oc: int) -> None\n",
      "     |      Attach optional content object to image or form xobject.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          xref: (int) xref number of an image or form xobject\n",
      "     |          oc: (int) xref number of an OCG or OCMD\n",
      "     |  \n",
      "     |  set_ocmd(doc: fitz.Document, xref: int = 0, ocgs: Optional[list] = None, policy: Optional[str] = None, ve: Optional[list] = None) -> int\n",
      "     |      Create or update an OCMD object in a PDF document.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          xref: (int) 0 for creating a new object, otherwise update existing one.\n",
      "     |          ocgs: (list) OCG xref numbers, which shall be subject to 'policy'.\n",
      "     |          policy: one of 'AllOn', 'AllOff', 'AnyOn', 'AnyOff' (any casing).\n",
      "     |          ve: (list) visibility expression. Use instead of 'ocgs' with 'policy'.\n",
      "     |      \n",
      "     |      Returns:\n",
      "     |          Xref of the created or updated OCMD.\n",
      "     |  \n",
      "     |  set_page_labels(doc, labels)\n",
      "     |      Add / replace page label definitions in PDF document.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          doc: PDF document (resp. 'self').\n",
      "     |          labels: list of label dictionaries like:\n",
      "     |          {'startpage': int, 'prefix': str, 'style': str, 'firstpagenum': int},\n",
      "     |          as returned by get_page_labels().\n",
      "     |  \n",
      "     |  set_pagelayout(self, pagelayout: str)\n",
      "     |      Set the PDF PageLayout value.\n",
      "     |  \n",
      "     |  set_pagemode(self, pagemode: str)\n",
      "     |      Set the PDF PageMode value.\n",
      "     |  \n",
      "     |  set_toc(doc: fitz.Document, toc: list, collapse: int = 1) -> int\n",
      "     |      Create new outline tree (table of contents, TOC).\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          toc: (list, tuple) each entry must contain level, title, page and\n",
      "     |              optionally top margin on the page. None or '()' remove the TOC.\n",
      "     |          collapse: (int) collapses entries beyond this level. Zero or None\n",
      "     |              shows all entries unfolded.\n",
      "     |      Returns:\n",
      "     |          the number of inserted items, or the number of removed items respectively.\n",
      "     |  \n",
      "     |  set_toc_item(doc: fitz.Document, idx: int, dest_dict: Optional[dict] = None, kind: Optional[int] = None, pno: Optional[int] = None, uri: Optional[str] = None, title: Optional[str] = None, to: 'point_like' = None, filename: Optional[str] = None, zoom: float = 0) -> None\n",
      "     |      Update TOC item by index.\n",
      "     |      \n",
      "     |      It allows changing the item's title and link destination.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          idx: (int) desired index of the TOC list, as created by get_toc.\n",
      "     |          dest_dict: (dict) destination dictionary as created by get_toc(False).\n",
      "     |              Outrules all other parameters. If None, the remaining parameters\n",
      "     |              are used to make a dest dictionary.\n",
      "     |          kind: (int) kind of link (fitz.LINK_GOTO, etc.). If None, then only the\n",
      "     |              title will be updated. If fitz.LINK_NONE, the TOC item will be deleted.\n",
      "     |          pno: (int) page number (1-based like in get_toc). Required if fitz.LINK_GOTO.\n",
      "     |          uri: (str) the URL, required if fitz.LINK_URI.\n",
      "     |          title: (str) the new title. No change if None.\n",
      "     |          to: (point-like) destination on the target page. If omitted, (72, 36)\n",
      "     |              will be used as taget coordinates.\n",
      "     |          filename: (str) destination filename, required for fitz.LINK_GOTOR and\n",
      "     |              fitz.LINK_LAUNCH.\n",
      "     |          name: (str) a destination name for fitz.LINK_NAMED.\n",
      "     |          zoom: (float) a zoom factor for the target location (fitz.LINK_GOTO).\n",
      "     |  \n",
      "     |  set_xml_metadata(self, metadata)\n",
      "     |      Store XML document level metadata.\n",
      "     |  \n",
      "     |  subset_fonts(doc: fitz.Document, verbose: bool = False) -> None\n",
      "     |      Build font subsets of a PDF. Requires package 'fontTools'.\n",
      "     |      \n",
      "     |      Eligible fonts are potentially replaced by smaller versions. Page text is\n",
      "     |      NOT rewritten and thus should retain properties like being hidden or\n",
      "     |      controlled by optional content.\n",
      "     |  \n",
      "     |  switch_layer(self, config, as_default=0)\n",
      "     |      Activate an OC layer.\n",
      "     |  \n",
      "     |  tobytes = write(self, garbage=False, clean=False, deflate=False, deflate_images=False, deflate_fonts=False, incremental=False, ascii=False, expand=False, linear=False, no_new_id=False, appearance=False, pretty=False, encryption=1, permissions=4095, owner_pw=None, user_pw=None, preserve_metadata=1, use_objstms=0, compression_effort=0)\n",
      "     |  \n",
      "     |  update_object(self, xref, text, page=None)\n",
      "     |      Replace object definition source.\n",
      "     |  \n",
      "     |  update_stream(self, xref=0, stream=None, new=1, compress=1)\n",
      "     |      Replace xref stream part.\n",
      "     |  \n",
      "     |  write(self, garbage=False, clean=False, deflate=False, deflate_images=False, deflate_fonts=False, incremental=False, ascii=False, expand=False, linear=False, no_new_id=False, appearance=False, pretty=False, encryption=1, permissions=4095, owner_pw=None, user_pw=None, preserve_metadata=1, use_objstms=0, compression_effort=0)\n",
      "     |  \n",
      "     |  xref_copy(doc: fitz.Document, source: int, target: int, *, keep: list = None) -> None\n",
      "     |      Copy a PDF dictionary object to another one given their xref numbers.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          doc: PDF document object\n",
      "     |          source: source xref number\n",
      "     |          target: target xref number, the xref must already exist\n",
      "     |          keep: an optional list of 1st level keys in target that should not be\n",
      "     |                removed before copying.\n",
      "     |      Notes:\n",
      "     |          This works similar to the copy() method of dictionaries in Python. The\n",
      "     |          source may be a stream object.\n",
      "     |  \n",
      "     |  xref_get_key(self, xref, key)\n",
      "     |      Get PDF dict key value of object at 'xref'.\n",
      "     |  \n",
      "     |  xref_get_keys(self, xref)\n",
      "     |      Get the keys of PDF dict object at 'xref'. Use -1 for the PDF trailer.\n",
      "     |  \n",
      "     |  xref_is_font(self, xref)\n",
      "     |      Check if xref is a font object.\n",
      "     |  \n",
      "     |  xref_is_image(self, xref)\n",
      "     |      Check if xref is an image object.\n",
      "     |  \n",
      "     |  xref_is_stream(self, xref=0)\n",
      "     |      Check if xref is a stream object.\n",
      "     |  \n",
      "     |  xref_is_xobject(self, xref)\n",
      "     |      Check if xref is a form xobject.\n",
      "     |  \n",
      "     |  xref_length(self)\n",
      "     |      Get length of xref table.\n",
      "     |  \n",
      "     |  xref_object(self, xref, compressed=0, ascii=0)\n",
      "     |      Get xref object source as a string.\n",
      "     |  \n",
      "     |  xref_set_key(self, xref, key, value)\n",
      "     |      Set the value of a PDF dictionary key.\n",
      "     |  \n",
      "     |  xref_stream(self, xref)\n",
      "     |      Get decompressed xref stream.\n",
      "     |  \n",
      "     |  xref_stream_raw(self, xref)\n",
      "     |      Get xref stream without decompression.\n",
      "     |  \n",
      "     |  xref_xml_metadata(self)\n",
      "     |      Get xref of document XML metadata.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties defined here:\n",
      "     |  \n",
      "     |  FormFonts\n",
      "     |      Get list of field font resource names.\n",
      "     |  \n",
      "     |  chapter_count\n",
      "     |      Number of chapters.\n",
      "     |  \n",
      "     |  is_dirty\n",
      "     |  \n",
      "     |  is_fast_webaccess\n",
      "     |      Check whether we have a linearized PDF.\n",
      "     |  \n",
      "     |  is_form_pdf\n",
      "     |      Either False or PDF field count.\n",
      "     |  \n",
      "     |  is_pdf\n",
      "     |      Check for PDF.\n",
      "     |  \n",
      "     |  is_reflowable\n",
      "     |      Check if document is layoutable.\n",
      "     |  \n",
      "     |  is_repaired\n",
      "     |      Check whether PDF was repaired.\n",
      "     |  \n",
      "     |  language\n",
      "     |      Document language.\n",
      "     |  \n",
      "     |  last_location\n",
      "     |      Id (chapter, page) of last page.\n",
      "     |  \n",
      "     |  markinfo\n",
      "     |      Return the PDF MarkInfo value.\n",
      "     |  \n",
      "     |  metadata\n",
      "     |  \n",
      "     |  name\n",
      "     |  \n",
      "     |  needs_pass\n",
      "     |      Indicate password required.\n",
      "     |  \n",
      "     |  outline\n",
      "     |  \n",
      "     |  page_count\n",
      "     |      Number of pages.\n",
      "     |  \n",
      "     |  pagelayout\n",
      "     |      Return the PDF PageLayout value.\n",
      "     |  \n",
      "     |  pagemode\n",
      "     |      Return the PDF PageMode value.\n",
      "     |  \n",
      "     |  permissions\n",
      "     |      Document permissions.\n",
      "     |  \n",
      "     |  version_count\n",
      "     |      Count versions of PDF document.\n",
      "     |  \n",
      "     |  xref\n",
      "     |      PDF xref number of page.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  page_count2\n",
      "     |  \n",
      "     |  this\n",
      "     |  \n",
      "     |  this_is_pdf\n",
      "\n",
      "FUNCTIONS\n",
      "    ASSERT_PDF(cond)\n",
      "    \n",
      "    CheckColor(c: Optional[Sequence])\n",
      "    \n",
      "    CheckFont(page: fitz.Page, fontname: str) -> tuple\n",
      "        Return an entry in the page's font list if reference name matches.\n",
      "    \n",
      "    CheckFontInfo(doc: fitz.Document, xref: int) -> list\n",
      "        Return a font info if present in the document.\n",
      "    \n",
      "    CheckMarkerArg(quads: Any) -> tuple\n",
      "    \n",
      "    CheckMorph(o: Any) -> bool\n",
      "    \n",
      "    CheckParent(o: Any)\n",
      "    \n",
      "    CheckQuad(q: Any) -> bool\n",
      "        Check whether an object is convex, not empty  quad-like.\n",
      "        \n",
      "        It must be a sequence of 4 number pairs.\n",
      "    \n",
      "    CheckRect(r: Any) -> bool\n",
      "        Check whether an object is non-degenerate rect-like.\n",
      "        \n",
      "        It must be a sequence of 4 numbers.\n",
      "    \n",
      "    ColorCode(c: Union[list, tuple, float, NoneType], f: str) -> str\n",
      "    \n",
      "    ConversionHeader(i: str, filename: Optional[str] = 'unknown')\n",
      "    \n",
      "    ConversionTrailer(i: str)\n",
      "    \n",
      "    EMPTY_IRECT()\n",
      "    \n",
      "    EMPTY_QUAD()\n",
      "    \n",
      "    EMPTY_RECT()\n",
      "    \n",
      "    ENSURE_OPERATION(pdf)\n",
      "    \n",
      "    INFINITE_IRECT()\n",
      "    \n",
      "    INFINITE_QUAD()\n",
      "    \n",
      "    INFINITE_RECT()\n",
      "    \n",
      "    JM_BinFromBuffer(buffer_)\n",
      "        Turn fz_buffer into a Python bytes object\n",
      "    \n",
      "    JM_BufferFromBytes(stream)\n",
      "        Make fz_buffer from a PyBytes, PyByteArray or io.BytesIO object. If a text\n",
      "        io.BytesIO, we convert to binary by encoding as utf8.\n",
      "    \n",
      "    JM_EscapeStrFromBuffer(buff)\n",
      "    \n",
      "    JM_EscapeStrFromStr(c)\n",
      "    \n",
      "    JM_FLOAT_ITEM(obj, idx)\n",
      "    \n",
      "    JM_INT_ITEM(obj, idx)\n",
      "    \n",
      "    JM_StrAsChar(x)\n",
      "    \n",
      "    JM_TUPLE(o: Sequence) -> tuple\n",
      "    \n",
      "    JM_TUPLE3(o: Sequence) -> tuple\n",
      "    \n",
      "    JM_UnicodeFromBuffer(buff)\n",
      "    \n",
      "    JM_UnicodeFromStr(s)\n",
      "    \n",
      "    JM_Warning(id)\n",
      "        put a warning on Python-stdout\n",
      "    \n",
      "    JM_add_annot_id(annot, stem)\n",
      "        Add a unique /NM key to an annotation or widget.\n",
      "        Append a number to 'stem' such that the result is a unique name.\n",
      "    \n",
      "    JM_add_layer_config(pdf, name, creator, ON)\n",
      "        Add OC configuration to the PDF catalog\n",
      "    \n",
      "    JM_add_oc_object(pdf, ref, xref)\n",
      "        Add OC object reference to a dictionary\n",
      "    \n",
      "    JM_annot_border(annot_obj)\n",
      "    \n",
      "    JM_annot_colors(annot_obj)\n",
      "    \n",
      "    JM_annot_set_border(border, doc, annot_obj)\n",
      "    \n",
      "    JM_append_rune(buff, ch)\n",
      "        APPEND non-ascii runes in unicode escape format to fz_buffer.\n",
      "    \n",
      "    JM_append_word(lines, buff, wbbox, block_n, line_n, word_n)\n",
      "        Functions for wordlist output\n",
      "    \n",
      "    JM_char_bbox(line, ch)\n",
      "        return rect of char quad\n",
      "    \n",
      "    JM_char_font_flags(font, line, ch)\n",
      "    \n",
      "    JM_char_quad(line, ch)\n",
      "        re-compute char quad if ascender/descender values make no sense\n",
      "    \n",
      "    JM_choice_options(annot)\n",
      "        return list of choices for list or combo boxes\n",
      "    \n",
      "    JM_clear_pixmap_rect_with_value(dest, value, b)\n",
      "        Clear a pixmap rectangle - my version also supports non-alpha pixmaps\n",
      "    \n",
      "    JM_color_FromSequence(color)\n",
      "    \n",
      "    JM_color_count(pm, clip)\n",
      "    \n",
      "    JM_compress_buffer(inbuffer)\n",
      "        compress char* into a new buffer\n",
      "    \n",
      "    JM_convert_to_pdf(doc, fp, tp, rotate)\n",
      "        Convert any MuPDF document to a PDF\n",
      "        Returns bytes object containing the PDF, created via 'write' function.\n",
      "    \n",
      "    JM_copy_rectangle(page, area)\n",
      "    \n",
      "    JM_create_widget(doc, page, type, fieldname)\n",
      "        # Copied from MuPDF v1.14\n",
      "        # Create widget\n",
      "    \n",
      "    JM_cropbox(page_obj)\n",
      "        return a PDF page's CropBox\n",
      "    \n",
      "    JM_cropbox_size(page_obj)\n",
      "    \n",
      "    JM_derotate_page_matrix(page)\n",
      "        just the inverse of rotation\n",
      "    \n",
      "    JM_embed_file(pdf, buf, filename, ufilename, desc, compress)\n",
      "        embed a new file in a PDF (not only /EmbeddedFiles entries)\n",
      "    \n",
      "    JM_embedded_clean(pdf)\n",
      "        perform some cleaning if we have /EmbeddedFiles:\n",
      "        (1) remove any /Limits if /Names exists\n",
      "        (2) remove any empty /Collection\n",
      "        (3) set /PageMode/UseAttachments\n",
      "    \n",
      "    JM_ensure_identity(pdf)\n",
      "        Store ID in PDF trailer\n",
      "    \n",
      "    JM_ensure_ocproperties(pdf)\n",
      "        Ensure OCProperties, return /OCProperties key\n",
      "    \n",
      "    JM_expand_fname(name)\n",
      "        Make /DA string of annotation\n",
      "    \n",
      "    JM_field_type_text(wtype)\n",
      "        String from widget type\n",
      "    \n",
      "    JM_fill_pixmap_rect_with_color(dest, col, b)\n",
      "    \n",
      "    JM_find_annot_irt(annot)\n",
      "        Return the first annotation whose /IRT key (\"In Response To\") points to\n",
      "        annot. Used to remove the response chain of a given annotation.\n",
      "    \n",
      "    JM_fitz_config()\n",
      "    \n",
      "    JM_font_ascender(font)\n",
      "        need own versions of ascender / descender\n",
      "    \n",
      "    JM_font_descender(font)\n",
      "        need own versions of ascender / descender\n",
      "    \n",
      "    JM_font_name(font)\n",
      "    \n",
      "    JM_gather_fonts(pdf, dict_, fontlist, stream_xref)\n",
      "    \n",
      "    JM_gather_forms(doc, dict_: fitz.mupdf.PdfObj, imagelist, stream_xref: int)\n",
      "        Store info of a /Form xobject in Python list\n",
      "    \n",
      "    JM_gather_images(doc: fitz.mupdf.PdfDocument, dict_: fitz.mupdf.PdfObj, imagelist, stream_xref: int)\n",
      "        Store info of an image in Python list\n",
      "    \n",
      "    JM_get_annot_by_name(page, name)\n",
      "        retrieve annot by name (/NM key)\n",
      "    \n",
      "    JM_get_annot_by_xref(page, xref)\n",
      "        retrieve annot by its xref\n",
      "    \n",
      "    JM_get_annot_id_list(page)\n",
      "    \n",
      "    JM_get_annot_xref_list(page_obj)\n",
      "        return the xrefs and /NM ids of a page's annots, links and fields\n",
      "    \n",
      "    JM_get_border_style(style)\n",
      "        return pdf_obj \"border style\" from Python str\n",
      "    \n",
      "    JM_get_font(fontname, fontfile, fontbuffer, script, lang, ordering, is_bold, is_italic, is_serif, embed)\n",
      "        return a fz_font from a number of parameters\n",
      "    \n",
      "    JM_get_fontbuffer(doc, xref)\n",
      "        Return the contents of a font file, identified by xref\n",
      "    \n",
      "    JM_get_fontextension(doc, xref)\n",
      "        Return the file extension of a font file, identified by xref\n",
      "    \n",
      "    JM_get_ocg_arrays(conf)\n",
      "    \n",
      "    JM_get_ocg_arrays_imp(arr)\n",
      "        Get OCG arrays from OC configuration\n",
      "        Returns dict {\"basestate\":name, \"on\":list, \"off\":list, \"rbg\":list, \"locked\":list}\n",
      "    \n",
      "    JM_get_page_labels(liste, nums)\n",
      "    \n",
      "    JM_get_resource_properties(ref)\n",
      "        Return the items of Resources/Properties (used for Marked Content)\n",
      "        Argument may be e.g. a page object or a Form XObject\n",
      "    \n",
      "    JM_get_script(key)\n",
      "        JavaScript extractor\n",
      "        Returns either the script source or None. Parameter is a PDF action\n",
      "        dictionary, which must have keys /S and /JS. The value of /S must be\n",
      "        '/JavaScript'. The value of /JS is returned.\n",
      "    \n",
      "    JM_get_widget_by_xref(page, xref)\n",
      "        retrieve widget by its xref\n",
      "    \n",
      "    JM_get_widget_properties(annot, Widget)\n",
      "        Populate a Python Widget object with the values from a PDF form field.\n",
      "        Called by \"Page.first_widget\" and \"Widget.next\".\n",
      "    \n",
      "    JM_have_operation(pdf)\n",
      "        Ensure valid journalling state\n",
      "    \n",
      "    JM_image_extension(type_)\n",
      "        return extension for fitz image type\n",
      "    \n",
      "    JM_image_filter(opaque, ctm, name, image)\n",
      "    \n",
      "    JM_image_profile(imagedata, keep_image)\n",
      "        Return basic properties of an image provided as bytes or bytearray\n",
      "        The function creates an fz_image and optionally returns it.\n",
      "    \n",
      "    JM_image_reporter(page)\n",
      "    \n",
      "    JM_insert_contents(pdf, pageref, newcont, overlay)\n",
      "        Insert a buffer as a new separate /Contents object of a page.\n",
      "        1. Create a new stream object from buffer 'newcont'\n",
      "        2. If /Contents already is an array, then just prepend or append this object\n",
      "        3. Else, create new array and put old content obj and this object into it.\n",
      "           If the page had no /Contents before, just create a 1-item array.\n",
      "    \n",
      "    JM_insert_font(pdf, bfname, fontfile, fontbuffer, set_simple, idx, wmode, serif, encoding, ordering)\n",
      "        Insert a font in a PDF\n",
      "    \n",
      "    JM_invert_pixmap_rect(dest, b)\n",
      "        invert a rectangle - also supports non-alpha pixmaps\n",
      "    \n",
      "    JM_irect_from_py(r)\n",
      "        PySequence to mupdf.FzIrect. Default: infinite irect\n",
      "    \n",
      "    JM_is_jbig2_image(dict_)\n",
      "    \n",
      "    JM_is_word_delimiter(ch, delimiters)\n",
      "        Check if ch is an extra word delimiting character.\n",
      "    \n",
      "    JM_listbox_value(annot)\n",
      "        ListBox retrieve value\n",
      "    \n",
      "    JM_make_annot_DA(annot, ncol, col, fontname, fontsize)\n",
      "    \n",
      "    JM_make_image_block(block, block_dict)\n",
      "    \n",
      "    JM_make_spanlist(line_dict, line, raw, buff, tp_rect)\n",
      "    \n",
      "    JM_make_text_block(block, block_dict, raw, buff, tp_rect)\n",
      "    \n",
      "    JM_make_textpage_dict(tp, page_dict, raw)\n",
      "    \n",
      "    JM_matrix_from_py(m)\n",
      "    \n",
      "    JM_mediabox(page_obj)\n",
      "        return a PDF page's MediaBox\n",
      "    \n",
      "    JM_merge_range(doc_des, doc_src, spage, epage, apage, rotate, links, annots, show_progress, graft_map)\n",
      "        Copy a range of pages (spage, epage) from a source PDF to a specified\n",
      "        location (apage) of the target PDF.\n",
      "        If spage > epage, the sequence of source pages is reversed.\n",
      "    \n",
      "    JM_merge_resources(page, temp_res)\n",
      "        Merge the /Resources object created by a text pdf device into the page.\n",
      "        The device may have created multiple /ExtGState/Alp? and /Font/F? objects.\n",
      "        These need to be renamed (renumbered) to not overwrite existing page\n",
      "        objects from previous executions.\n",
      "        Returns the next available numbers n, m for objects /Alp<n>, /F<m>.\n",
      "    \n",
      "    JM_mupdf_error(message)\n",
      "    \n",
      "    JM_mupdf_warning(message)\n",
      "        redirect MuPDF warnings\n",
      "    \n",
      "    JM_new_bbox_device(rc, inc_layers)\n",
      "    \n",
      "    JM_new_buffer_from_stext_page(page)\n",
      "        make a buffer from an stext_page's text\n",
      "    \n",
      "    JM_new_javascript(pdf, value)\n",
      "        make new PDF action object from JavaScript source\n",
      "        Parameters are a PDF document and a Python string.\n",
      "        Returns a PDF action object.\n",
      "    \n",
      "    JM_new_output_fileptr(bio)\n",
      "    \n",
      "    JM_norm_rotation(rotate)\n",
      "        # return normalized /Rotate value:one of 0, 90, 180, 270\n",
      "    \n",
      "    JM_object_to_buffer(what, compress, ascii)\n",
      "    \n",
      "    JM_outline_xrefs(obj, xrefs)\n",
      "        Return list of outline xref numbers. Recursive function. Arguments:\n",
      "        'obj' first OL item\n",
      "        'xrefs' empty Python list\n",
      "    \n",
      "    JM_page_rotation(page)\n",
      "        return a PDF page's /Rotate value: one of (0, 90, 180, 270)\n",
      "    \n",
      "    JM_pdf_obj_from_str(doc, src)\n",
      "        create PDF object from given string (new in v1.14.0: MuPDF dropped it)\n",
      "    \n",
      "    JM_pixmap_from_display_list(list_, ctm, cs, alpha, clip, seps)\n",
      "        Version of fz_new_pixmap_from_display_list (util.c) to also support\n",
      "        rendering of only the 'clip' part of the displaylist rectangle\n",
      "    \n",
      "    JM_pixmap_from_page(doc, page, ctm, cs, alpha, annots, clip)\n",
      "        Pixmap creation directly using a short-lived displaylist, so we can support\n",
      "        separations.\n",
      "    \n",
      "    JM_point_from_py(p)\n",
      "        PySequence to fz_point. Default: (FZ_MIN_INF_RECT, FZ_MIN_INF_RECT)\n",
      "    \n",
      "    JM_print_stext_page_as_text(res, page)\n",
      "        Plain text output. An identical copy of fz_print_stext_page_as_text,\n",
      "        but lines within a block are concatenated by space instead a new-line\n",
      "        character (which else leads to 2 new-lines).\n",
      "    \n",
      "    JM_put_script(annot_obj, key1, key2, value)\n",
      "        Create a JavaScript PDF action.\n",
      "        Usable for all object types which support PDF actions, even if the\n",
      "        argument name suggests annotations. Up to 2 key values can be specified, so\n",
      "        JavaScript actions can be stored for '/A' and '/AA/?' keys.\n",
      "    \n",
      "    JM_py_from_irect(r)\n",
      "    \n",
      "    JM_py_from_matrix(m)\n",
      "    \n",
      "    JM_py_from_point(p)\n",
      "    \n",
      "    JM_py_from_quad(q)\n",
      "        PySequence from fz_quad.\n",
      "    \n",
      "    JM_py_from_rect(r)\n",
      "    \n",
      "    JM_quad_from_py(r)\n",
      "    \n",
      "    JM_read_contents(pageref)\n",
      "        Read and concatenate a PDF page's /Conents object(s) in a buffer\n",
      "    \n",
      "    JM_rect_from_py(r)\n",
      "    \n",
      "    JM_rects_overlap(a, b)\n",
      "    \n",
      "    JM_refresh_links(page)\n",
      "        refreshes the link and annotation tables of a page\n",
      "    \n",
      "    JM_rotate_page_matrix(page)\n",
      "        calculate page rotation matrices\n",
      "    \n",
      "    JM_scan_resources(pdf, rsrc, liste, what, stream_xref, tracer)\n",
      "        Step through /Resources, looking up image, xobject or font information\n",
      "    \n",
      "    JM_search_stext_page(page, needle)\n",
      "    \n",
      "    JM_set_choice_options(annot, liste)\n",
      "        set ListBox / ComboBox values\n",
      "    \n",
      "    JM_set_field_type(doc, obj, type)\n",
      "        Set the field type\n",
      "    \n",
      "    JM_set_object_value(obj, key, value)\n",
      "        Set a PDF dict key to some value\n",
      "    \n",
      "    JM_set_ocg_arrays(conf, basestate, on, off, rbgroups, locked)\n",
      "    \n",
      "    JM_set_ocg_arrays_imp(arr, list_)\n",
      "        Set OCG arrays from dict of Python lists\n",
      "        Works with dict like {\"basestate\":name, \"on\":list, \"off\":list, \"rbg\":list}\n",
      "    \n",
      "    JM_set_resource_property(ref, name, xref)\n",
      "        Insert an item into Resources/Properties (used for Marked Content)\n",
      "        Arguments:\n",
      "        (1) e.g. page object, Form XObject\n",
      "        (2) marked content name\n",
      "        (3) xref of the referenced object (insert as indirect reference)\n",
      "    \n",
      "    JM_set_widget_properties(annot, Widget)\n",
      "        Update the PDF form field with the properties from a Python Widget object.\n",
      "        Called by \"Page.add_widget\" and \"Annot.update_widget\".\n",
      "    \n",
      "    JM_show_string_cs(text, user_font, trm, s, wmode, bidi_level, markup_dir, language)\n",
      "    \n",
      "    JM_update_stream(doc, obj, buffer_, compress)\n",
      "        update a stream object\n",
      "        compress stream when beneficial\n",
      "    \n",
      "    JM_xobject_from_page(pdfout, fsrcpage, xref, gmap)\n",
      "        Make an XObject from a PDF page\n",
      "        For a positive xref assume that its object can be used instead\n",
      "    \n",
      "    PDF_NAME(x)\n",
      "    \n",
      "    Page__add_text_marker(self, quads, annot_type)\n",
      "    \n",
      "    PySequence_Check(s)\n",
      "    \n",
      "    PySequence_Size(s)\n",
      "    \n",
      "    PySys_WriteStderr(text)\n",
      "    \n",
      "    PySys_WriteStdout(text)\n",
      "    \n",
      "    PyUnicode_DecodeRawUnicodeEscape(s, errors='strict')\n",
      "    \n",
      "    RAISEPY(msg, exc)\n",
      "    \n",
      "    UpdateFontInfo(doc: fitz.Document, info: Sequence)\n",
      "    \n",
      "    adobe_glyph_names() -> tuple\n",
      "        Adobe Glyph List function\n",
      "    \n",
      "    adobe_glyph_unicodes() -> tuple\n",
      "        Adobe Glyph List function\n",
      "    \n",
      "    annot_postprocess(page: 'Page', annot: 'Annot') -> None\n",
      "        Clean up after annotation inertion.\n",
      "        \n",
      "        Set ownership flag and store annotation in page annotation dictionary.\n",
      "    \n",
      "    annot_preprocess(page: 'Page') -> int\n",
      "        Prepare for annotation insertion on the page.\n",
      "        \n",
      "        Returns:\n",
      "            Old page rotation value. Temporarily sets rotation to 0 when required.\n",
      "    \n",
      "    args_match(args, *types)\n",
      "        Returns true if <args> matches <types>.\n",
      "        \n",
      "        Each item in <types> is a type or tuple of types. Any of these types will\n",
      "        match an item in <args>. `None` will match anything in <args>. `type(None)`\n",
      "        will match an arg whose value is `None`.\n",
      "    \n",
      "    calc_image_matrix(width, height, tr, rotate, keep)\n",
      "        # compute image insertion matrix\n",
      "    \n",
      "    canon(c)\n",
      "    \n",
      "    chartocanon(s)\n",
      "    \n",
      "    compute_scissor(dev)\n",
      "        Every scissor of a clip is a sub rectangle of the preceeding clip scissor\n",
      "        if the clip level is larger.\n",
      "    \n",
      "    css_for_pymupdf_font(fontcode: str, *, CSS: Optional[str] = None, archive: Any = None, name: Optional[str] = None) -> str\n",
      "        Create @font-face items for the given fontcode of pymupdf-fonts.\n",
      "        \n",
      "        Adds @font-face support for fonts contained in package pymupdf-fonts.\n",
      "        \n",
      "        Creates a CSS font-family for all fonts starting with string 'fontcode'.\n",
      "        \n",
      "        Note:\n",
      "            The font naming convention in package pymupdf-fonts is \"fontcode<sf>\",\n",
      "            where the suffix \"sf\" is either empty or one of \"it\", \"bo\" or \"bi\".\n",
      "            These suffixes thus represent the regular, italic, bold or bold-italic\n",
      "            variants of a font. For example, font code \"notos\" refers to fonts\n",
      "            \"notos\" - \"Noto Sans Regular\"\n",
      "            \"notosit\" - \"Noto Sans Italic\"\n",
      "            \"notosbo\" - \"Noto Sans Bold\"\n",
      "            \"notosbi\" - \"Noto Sans Bold Italic\"\n",
      "        \n",
      "            This function creates four CSS @font-face definitions and collectively\n",
      "            assigns the font-family name \"notos\" to them (or the \"name\" value).\n",
      "        \n",
      "        All fitting font buffers of the pymupdf-fonts package are placed / added\n",
      "        to the archive provided as parameter.\n",
      "        To use the font in fitz.Story, execute 'set_font(fontcode)'. The correct\n",
      "        font weight (bold) or style (italic) will automatically be selected.\n",
      "        Expects and returns the CSS source, with the new CSS definitions appended.\n",
      "        \n",
      "        Args:\n",
      "            fontcode: (str) font code for naming the font variants to include.\n",
      "                      E.g. \"fig\" adds notos, notosi, notosb, notosbi fonts.\n",
      "                      A maximum of 4 font variants is accepted.\n",
      "            CSS: (str) CSS string to add @font-face definitions to.\n",
      "            archive: (Archive, mandatory) where to place the font buffers.\n",
      "            name: (str) use this as family-name instead of 'fontcode'.\n",
      "        Returns:\n",
      "            Modified CSS, with appended @font-face statements for each font variant\n",
      "            of fontcode.\n",
      "            Fontbuffers associated with \"fontcode\" will be added to 'archive'.\n",
      "    \n",
      "    dest_is_valid(o, page_count, page_object_nums, names_list)\n",
      "    \n",
      "    dest_is_valid_page(obj, page_object_nums, pagecount)\n",
      "    \n",
      "    detect_super_script(line, ch)\n",
      "    \n",
      "    dir_str(x)\n",
      "    \n",
      "    exception_info()\n",
      "    \n",
      "    find_string(s, needle)\n",
      "    \n",
      "    getTJstr(text: str, glyphs: Union[list, tuple, NoneType], simple: bool, ordering: int) -> str\n",
      "        Return a PDF string enclosed in [] brackets, suitable for the PDF TJ\n",
      "        operator.\n",
      "        \n",
      "        Notes:\n",
      "            The input string is converted to either 2 or 4 hex digits per character.\n",
      "        Args:\n",
      "            simple: no glyphs: 2-chars, use char codes as the glyph\n",
      "                    glyphs: 2-chars, use glyphs instead of char codes (Symbol,\n",
      "                    ZapfDingbats)\n",
      "            not simple: ordering < 0: 4-chars, use glyphs not char codes\n",
      "                        ordering >=0: a CJK font! 4 chars, use char codes as glyphs\n",
      "    \n",
      "    get_env_bool(name, default)\n",
      "        Returns `True`, `False` or `default` depending on whether $<name> is '1',\n",
      "        '0' or unset. Otherwise assert-fails.\n",
      "    \n",
      "    get_env_int(name, default)\n",
      "        Returns `True`, `False` or `default` depending on whether $<name> is '1',\n",
      "        '0' or unset. Otherwise assert-fails.\n",
      "    \n",
      "    get_highlight_selection(page, start: 'point_like' = None, stop: 'point_like' = None, clip: 'rect_like' = None) -> list\n",
      "        Return rectangles of text lines between two points.\n",
      "        \n",
      "        Notes:\n",
      "            The default of 'start' is top-left of 'clip'. The default of 'stop'\n",
      "            is bottom-reight of 'clip'.\n",
      "        \n",
      "        Args:\n",
      "            start: start point_like\n",
      "            stop: end point_like, must be 'below' start\n",
      "            clip: consider this rect_like only, default is page rectangle\n",
      "        Returns:\n",
      "            List of line bbox intersections with the area established by the\n",
      "            parameters.\n",
      "    \n",
      "    get_pdf_now() -> str\n",
      "        \"Now\" timestamp in PDF Format\n",
      "    \n",
      "    get_pdf_str(s: str) -> str\n",
      "        Return a PDF string depending on its coding.\n",
      "        \n",
      "            Notes:\n",
      "                Returns a string bracketed with either \"()\" or \"<>\" for hex values.\n",
      "                If only ascii then \"(original)\" is returned, else if only 8 bit chars\n",
      "                then \"(original)\" with interspersed octal strings \n",
      "        nn is returned,\n",
      "                else a string \"<FEFF[hexstring]>\" is returned, where [hexstring] is the\n",
      "                UTF-16BE encoding of the original.\n",
      "    \n",
      "    get_tessdata() -> str\n",
      "        Detect Tesseract-OCR and return its language support folder.\n",
      "        \n",
      "        This function can be used to enable OCR via Tesseract even if the\n",
      "        environment variable TESSDATA_PREFIX has not been set.\n",
      "        If the value of TESSDATA_PREFIX is None, the function tries to locate\n",
      "        Tesseract-OCR and fills the required variable.\n",
      "        \n",
      "        Returns:\n",
      "            Folder name of tessdata if Tesseract-OCR is available, otherwise False.\n",
      "    \n",
      "    get_text_length(text: str, fontname: str = 'helv', fontsize: float = 11, encoding: int = 0) -> float\n",
      "        Calculate length of a string for a built-in font.\n",
      "        \n",
      "        Args:\n",
      "            fontname: name of the font.\n",
      "            fontsize: font size points.\n",
      "            encoding: encoding to use, 0=Latin (default), 1=Greek, 2=Cyrillic.\n",
      "        Returns:\n",
      "            (float) length of text.\n",
      "    \n",
      "    glyph_name_to_unicode(name: str) -> int\n",
      "        Adobe Glyph List function\n",
      "    \n",
      "    hdist(dir, a, b)\n",
      "    \n",
      "    image_profile(img: ByteString) -> dict\n",
      "        Return basic properties of an image.\n",
      "        \n",
      "        Args:\n",
      "            img: bytes, bytearray, io.BytesIO object or an opened image file.\n",
      "        Returns:\n",
      "            A dictionary with keys width, height, colorspace.n, bpc, type, ext and size,\n",
      "            where 'type' is the MuPDF image type (0 to 14) and 'ext' the suitable\n",
      "            file extension.\n",
      "    \n",
      "    int_rc(text)\n",
      "        Converts string to int, ignoring trailing 'rc...'.\n",
      "    \n",
      "    jm_append_merge(dev)\n",
      "        Append current path to list or merge into last path of the list.\n",
      "        (1) Append if first path, different item lists or not a 'stroke' version\n",
      "            of previous path\n",
      "        (2) If new path has the same items, merge its content into previous path\n",
      "            and change path[\"type\"] to \"fs\".\n",
      "        (3) If \"out\" is callable, skip the previous and pass dictionary to it.\n",
      "    \n",
      "    jm_bbox_add_rect(dev, ctx, rect, code)\n",
      "    \n",
      "    jm_bbox_fill_image(dev, ctx, image, ctm, alpha, color_params)\n",
      "    \n",
      "    jm_bbox_fill_image_mask(dev, ctx, image, ctm, colorspace, color, alpha, color_params)\n",
      "    \n",
      "    jm_bbox_fill_path(dev, ctx, path, even_odd, ctm, colorspace, color, alpha, color_params)\n",
      "    \n",
      "    jm_bbox_fill_shade(dev, ctx, shade, ctm, alpha, color_params)\n",
      "    \n",
      "    jm_bbox_fill_text(dev, ctx, text, ctm, *args)\n",
      "    \n",
      "    jm_bbox_ignore_text(dev, ctx, text, ctm)\n",
      "    \n",
      "    jm_bbox_stroke_path(dev, ctx, path, stroke, ctm, colorspace, color, alpha, color_params)\n",
      "    \n",
      "    jm_bbox_stroke_text(dev, ctx, text, stroke, ctm, *args)\n",
      "    \n",
      "    jm_checkquad(dev)\n",
      "        Check whether the last 4 lines represent a quad.\n",
      "        Because of how we count, the lines are a polyline already, i.e. last point\n",
      "        of a line equals 1st point of next line.\n",
      "        So we check for a polygon (last line's end point equals start point).\n",
      "        If not true we return 0.\n",
      "    \n",
      "    jm_checkrect(dev)\n",
      "        Check whether the last 3 path items represent a rectangle.\n",
      "        Returns 1 if we have modified the path, otherwise 0.\n",
      "    \n",
      "    jm_dev_linewidth(dev, ctx, path, stroke, matrix, colorspace, color, alpha, color_params)\n",
      "    \n",
      "    jm_increase_seqno(dev, ctx, *vargs)\n",
      "    \n",
      "    jm_lineart_begin_group(dev, ctx, bbox, cs, isolated, knockout, blendmode, alpha)\n",
      "    \n",
      "    jm_lineart_begin_layer(dev, ctx, name)\n",
      "    \n",
      "    jm_lineart_clip_image_mask(dev, ctx, image, ctm, scissor)\n",
      "    \n",
      "    jm_lineart_clip_path(dev, ctx, path, even_odd, ctm, scissor)\n",
      "    \n",
      "    jm_lineart_clip_stroke_path(dev, ctx, path, stroke, ctm, scissor)\n",
      "    \n",
      "    jm_lineart_clip_stroke_text(dev, ctx, text, stroke, ctm, scissor)\n",
      "    \n",
      "    jm_lineart_clip_text(dev, ctx, text, ctm, scissor)\n",
      "    \n",
      "    jm_lineart_color(colorspace, color)\n",
      "    \n",
      "    jm_lineart_drop_device(dev, ctx)\n",
      "    \n",
      "    jm_lineart_end_group(dev, ctx)\n",
      "    \n",
      "    jm_lineart_end_layer(dev, ctx)\n",
      "    \n",
      "    jm_lineart_fill_path(dev, ctx, path, even_odd, ctm, colorspace, color, alpha, color_params)\n",
      "    \n",
      "    jm_lineart_fill_text(dev, ctx, text, ctm, colorspace, color, alpha, color_params)\n",
      "    \n",
      "    jm_lineart_ignore_text(dev, text, ctm)\n",
      "    \n",
      "    jm_lineart_path(dev, ctx, path)\n",
      "        Create the \"items\" list of the path dictionary\n",
      "        * either create or empty the path dictionary\n",
      "        * reset the end point of the path\n",
      "        * reset count of consecutive lines\n",
      "        * invoke fz_walk_path(), which create the single items\n",
      "        * if no items detected, empty path dict again\n",
      "    \n",
      "    jm_lineart_pop_clip(dev, ctx)\n",
      "    \n",
      "    jm_lineart_stroke_path(dev, ctx, path, stroke, ctm, colorspace, color, alpha, color_params)\n",
      "    \n",
      "    jm_lineart_stroke_text(dev, ctx, text, stroke, ctm, colorspace, color, alpha, color_params)\n",
      "    \n",
      "    jm_trace_text(dev, text, type_, ctm, colorspace, color, alpha, seqno)\n",
      "    \n",
      "    jm_trace_text_span(dev, span, type_, ctm, colorspace, color, alpha, seqno)\n",
      "        jm_trace_text_span(fz_context *ctx, PyObject *out, fz_text_span *span, int type, fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, size_t seqno)\n",
      "    \n",
      "    log(text='', caller=1)\n",
      "        For development/debugging diagnostics.\n",
      "    \n",
      "    make_escape(ch)\n",
      "    \n",
      "    make_story_elpos()\n",
      "    \n",
      "    make_table(rect: 'rect_like' = (0, 0, 1, 1), cols: int = 1, rows: int = 1) -> list\n",
      "        Return a list of (rows x cols) equal sized rectangles.\n",
      "        \n",
      "        Notes:\n",
      "            A utility to fill a given area with table cells of equal size.\n",
      "        Args:\n",
      "            rect: rect_like to use as the table area\n",
      "            rows: number of rows\n",
      "            cols: number of columns\n",
      "        Returns:\n",
      "            A list with <rows> items, where each item is a list of <cols>\n",
      "            PyMuPDF Rect objects of equal sizes.\n",
      "    \n",
      "    match_string(h0, n0)\n",
      "    \n",
      "    message(text='')\n",
      "        For user messages.\n",
      "    \n",
      "    on_highlight_char(hits, line, ch)\n",
      "    \n",
      "    page_merge(doc_des, doc_src, page_from, page_to, rotate, links, copy_annots, graft_map)\n",
      "        Deep-copies a source page to the target.\n",
      "        Modified version of function of pdfmerge.c: we also copy annotations, but\n",
      "        we skip some subtypes. In addition we rotate output.\n",
      "    \n",
      "    paper_rect(s: str) -> fitz.Rect\n",
      "        Return a Rect for the paper size indicated in string 's'. Must conform to the argument of method 'PaperSize', which will be invoked.\n",
      "    \n",
      "    paper_size(s: str) -> tuple\n",
      "        Return a tuple (width, height) for a given paper format string.\n",
      "        \n",
      "        Notes:\n",
      "            'A4-L' will return (842, 595), the values for A4 landscape.\n",
      "            Suffix '-P' and no suffix return the portrait tuple.\n",
      "    \n",
      "    paper_sizes()\n",
      "        Known paper formats @ 72 dpi as a dictionary. Key is the format string\n",
      "        like \"a4\" for ISO-A4. Value is the tuple (width, height).\n",
      "        \n",
      "        Information taken from the following web sites:\n",
      "        www.din-formate.de\n",
      "        www.din-formate.info/amerikanische-formate.html\n",
      "        www.directtools.de/wissen/normen/iso.htm\n",
      "    \n",
      "    pdf_lookup_page_loc(doc, needle)\n",
      "    \n",
      "    pdfobj_string(o, prefix='')\n",
      "        Returns description of mupdf.PdfObj (wrapper for pdf_obj) <o>.\n",
      "    \n",
      "    planish_line(p1: 'point_like', p2: 'point_like') -> fitz.Matrix\n",
      "        Compute matrix which maps line from p1 to p2 to the x-axis, such that it\n",
      "        maintains its length and p1 * matrix = Point(0, 0).\n",
      "        \n",
      "        Args:\n",
      "            p1, p2: point_like\n",
      "        Returns:\n",
      "            Matrix which maps p1 to Point(0, 0) and p2 to a point on the x axis at\n",
      "            the same distance to Point(0,0). Will always combine a rotation and a\n",
      "            transformation.\n",
      "    \n",
      "    repair_mono_font(page: 'Page', font: 'Font') -> None\n",
      "        Repair character spacing for mono fonts.\n",
      "        \n",
      "        Notes:\n",
      "            Some mono-spaced fonts are displayed with a too large character\n",
      "            distance, e.g. \"a b c\" instead of \"abc\". This utility adds an entry\n",
      "            \"/W[0 65535 w]\" to the descendent font(s) of font. The float w is\n",
      "            taken to be the width of 0x20 (space).\n",
      "            This should enforce viewers to use 'w' as the character width.\n",
      "        \n",
      "        Args:\n",
      "            page: fitz.Page object.\n",
      "            font: fitz.Font object.\n",
      "    \n",
      "    restore_aliases()\n",
      "    \n",
      "    sRGB_to_pdf(srgb: int) -> tuple\n",
      "        Convert sRGB color code to a PDF color triple.\n",
      "        \n",
      "        There is **no error checking** for performance reasons!\n",
      "        \n",
      "        Args:\n",
      "            srgb: (int) RRGGBB (red, green, blue), each color in range(255).\n",
      "        Returns:\n",
      "            Tuple (red, green, blue) each item in intervall 0 <= item <= 1.\n",
      "    \n",
      "    sRGB_to_rgb(srgb: int) -> tuple\n",
      "        Convert sRGB color code to an RGB color triple.\n",
      "        \n",
      "        There is **no error checking** for performance reasons!\n",
      "        \n",
      "        Args:\n",
      "            srgb: (int) RRGGBB (red, green, blue), each color in range(255).\n",
      "        Returns:\n",
      "            Tuple (red, green, blue) each item in intervall 0 <= item <= 255.\n",
      "    \n",
      "    string_in_names_list(p, names_list)\n",
      "    \n",
      "    strip_outline(doc, outlines, page_count, page_object_nums, names_list)\n",
      "        Returns (count, first, prev).\n",
      "    \n",
      "    strip_outlines(doc, outlines, page_count, page_object_nums, names_list)\n",
      "    \n",
      "    unicode_to_glyph_name(ch: int) -> str\n",
      "        Adobe Glyph List function\n",
      "    \n",
      "    util_concat_matrix(m1, m2)\n",
      "    \n",
      "    util_ensure_widget_calc(annot)\n",
      "        Ensure that widgets with /AA/C JavaScript are in array AcroForm/CO\n",
      "    \n",
      "    util_hor_matrix(C, P)\n",
      "        Return the matrix that maps two points C, P to the x-axis such that\n",
      "        C -> (0,0) and the image of P have the same distance.\n",
      "    \n",
      "    util_include_point_in_rect(r, p)\n",
      "    \n",
      "    util_intersect_rect(r1, r2)\n",
      "    \n",
      "    util_invert_matrix(matrix)\n",
      "    \n",
      "    util_is_point_in_rect(p, r)\n",
      "    \n",
      "    util_make_irect(*args, p0=None, p1=None, x0=None, y0=None, x1=None, y1=None)\n",
      "    \n",
      "    util_make_rect(*args, p0=None, p1=None, x0=None, y0=None, x1=None, y1=None)\n",
      "        Helper for initialising rectangle classes.\n",
      "        \n",
      "        2022-09-02: This is quite different from PyMuPDF's util_make_rect(), which\n",
      "        uses `goto` in ways that don't easily translate to Python.\n",
      "        \n",
      "        Returns (x0, y0, x1, y1) derived from <args>, then override with p0, p1,\n",
      "        x0, y0, x1, y1 if they are not None.\n",
      "        \n",
      "        Accepts following forms for <args>:\n",
      "            () returns all zeros.\n",
      "            (top-left, bottom-right)\n",
      "            (top-left, x1, y1)\n",
      "            (x0, y0, bottom-right)\n",
      "            (x0, y0, x1, y1)\n",
      "            (rect)\n",
      "        \n",
      "        Where top-left and bottom-right are (x, y) or something with .x, .y\n",
      "        members; rect is something with .x0, .y0, .x1, and .y1 members.\n",
      "        \n",
      "        2023-11-18: we now override with p0, p1, x0, y0, x1, y1 if not None.\n",
      "    \n",
      "    util_measure_string(text, fontname, fontsize, encoding)\n",
      "    \n",
      "    util_point_in_quad(P, Q)\n",
      "    \n",
      "    util_round_rect(rect)\n",
      "    \n",
      "    util_sine_between(C, P, Q)\n",
      "    \n",
      "    util_transform_point(point, matrix)\n",
      "    \n",
      "    util_transform_rect(rect, matrix)\n",
      "    \n",
      "    util_union_rect(r1, r2)\n",
      "    \n",
      "    vdist(dir, a, b)\n",
      "\n",
      "DATA\n",
      "    AnyType = typing.Any\n",
      "        Special type indicating an unconstrained type.\n",
      "        \n",
      "        - Any is compatible with every type.\n",
      "        - Any assumed to have all methods.\n",
      "        - All values assumed to be instances of Any.\n",
      "        \n",
      "        Note that all the above statements are true from the point of view of\n",
      "        static type checkers. At runtime, Any should not be used with instance\n",
      "        or class checks.\n",
      "    \n",
      "    Base14_fontdict = {'cobi': 'Courier-BoldOblique', 'cobo': 'Courier-Bol...\n",
      "    Base14_fontnames = ('Courier', 'Courier-Oblique', 'Courier-Bold', 'Cou...\n",
      "    CS_CMYK = 3\n",
      "    CS_GRAY = 2\n",
      "    CS_RGB = 1\n",
      "    EPSILON = 1e-05\n",
      "    FLT_EPSILON = 1e-05\n",
      "    FZ_MAX_INF_RECT = 2147483520\n",
      "    FZ_MIN_INF_RECT = -2147483648\n",
      "    INVALID_NAME_CHARS = {'\\x00', '\\t', '\\n', '\\x0b', '\\x0c', '\\r', ...}\n",
      "    Identity = IdentityMatrix(1.0, 0.0, 0.0, 1.0, 0.0, 0.0)\n",
      "    JM_Exc_FileDataError = 'FileDataError'\n",
      "    JM_MEMORY = 0\n",
      "    JM_annot_id_stem = 'fitz'\n",
      "    JM_mupdf_show_errors = 1\n",
      "    JM_mupdf_show_warnings = 0\n",
      "    JM_mupdf_warnings_store = []\n",
      "    LINK_FLAG_B_VALID = 8\n",
      "    LINK_FLAG_FIT_H = 16\n",
      "    LINK_FLAG_FIT_V = 32\n",
      "    LINK_FLAG_L_VALID = 1\n",
      "    LINK_FLAG_R_IS_ZOOM = 64\n",
      "    LINK_FLAG_R_VALID = 4\n",
      "    LINK_FLAG_T_VALID = 2\n",
      "    LINK_GOTO = 1\n",
      "    LINK_GOTOR = 5\n",
      "    LINK_LAUNCH = 3\n",
      "    LINK_NAMED = 4\n",
      "    LINK_NONE = 0\n",
      "    LINK_URI = 2\n",
      "    MSG_BAD_ANNOT_TYPE = 'bad annot type'\n",
      "    MSG_BAD_APN = 'bad or missing annot AP/N'\n",
      "    MSG_BAD_ARG_INK_ANNOT = 'arg must be seq of seq of float pairs'\n",
      "    MSG_BAD_ARG_POINTS = 'bad seq of points'\n",
      "    MSG_BAD_BUFFER = \"bad type: 'buffer'\"\n",
      "    MSG_BAD_COLOR_SEQ = 'bad color sequence'\n",
      "    MSG_BAD_DOCUMENT = 'cannot open broken document'\n",
      "    MSG_BAD_FILETYPE = 'bad filetype'\n",
      "    MSG_BAD_LOCATION = 'bad location'\n",
      "    MSG_BAD_OC_CONFIG = 'bad config number'\n",
      "    MSG_BAD_OC_LAYER = 'bad layer number'\n",
      "    MSG_BAD_OC_REF = \"bad 'oc' reference\"\n",
      "    MSG_BAD_PAGEID = 'bad page id'\n",
      "    MSG_BAD_PAGENO = 'bad page number(s)'\n",
      "    MSG_BAD_PDFROOT = 'PDF has no root'\n",
      "    MSG_BAD_RECT = 'rect is infinite or empty'\n",
      "    MSG_BAD_TEXT = \"bad type: 'text'\"\n",
      "    MSG_BAD_XREF = 'bad xref'\n",
      "    MSG_COLOR_COUNT_FAILED = 'color count failed'\n",
      "    MSG_FILE_OR_BUFFER = 'need font file or buffer'\n",
      "    MSG_FONT_FAILED = 'cannot create font'\n",
      "    MSG_IS_NO_ANNOT = 'is no annotation'\n",
      "    MSG_IS_NO_DICT = 'object is no PDF dict'\n",
      "    MSG_IS_NO_IMAGE = 'is no image'\n",
      "    MSG_IS_NO_PDF = 'is no PDF'\n",
      "    MSG_PIXEL_OUTSIDE = 'pixel(s) outside image'\n",
      "    MSG_PIX_NOALPHA = 'source pixmap has no alpha'\n",
      "    OptBytes = typing.Optional[typing.ByteString]\n",
      "    OptDict = typing.Optional[dict]\n",
      "    OptFloat = typing.Optional[float]\n",
      "    OptInt = typing.Optional[int]\n",
      "    OptSeq = typing.Optional[typing.Sequence]\n",
      "    OptStr = typing.Optional[str]\n",
      "    PDF_ALERT_BUTTON_CANCEL = 2\n",
      "    PDF_ALERT_BUTTON_GROUP_OK = 0\n",
      "    PDF_ALERT_BUTTON_GROUP_OK_CANCEL = 1\n",
      "    PDF_ALERT_BUTTON_GROUP_YES_NO = 2\n",
      "    PDF_ALERT_BUTTON_GROUP_YES_NO_CANCEL = 3\n",
      "    PDF_ALERT_BUTTON_NO = 3\n",
      "    PDF_ALERT_BUTTON_NONE = 0\n",
      "    PDF_ALERT_BUTTON_OK = 1\n",
      "    PDF_ALERT_BUTTON_YES = 4\n",
      "    PDF_ALERT_ICON_ERROR = 0\n",
      "    PDF_ALERT_ICON_QUESTION = 2\n",
      "    PDF_ALERT_ICON_STATUS = 3\n",
      "    PDF_ALERT_ICON_WARNING = 1\n",
      "    PDF_ANNOT_3D = 26\n",
      "    PDF_ANNOT_CARET = 14\n",
      "    PDF_ANNOT_CIRCLE = 5\n",
      "    PDF_ANNOT_FILE_ATTACHMENT = 17\n",
      "    PDF_ANNOT_FREE_TEXT = 2\n",
      "    PDF_ANNOT_HIGHLIGHT = 8\n",
      "    PDF_ANNOT_INK = 15\n",
      "    PDF_ANNOT_IS_HIDDEN = 2\n",
      "    PDF_ANNOT_IS_INVISIBLE = 1\n",
      "    PDF_ANNOT_IS_LOCKED = 128\n",
      "    PDF_ANNOT_IS_LOCKED_CONTENTS = 512\n",
      "    PDF_ANNOT_IS_NO_ROTATE = 16\n",
      "    PDF_ANNOT_IS_NO_VIEW = 32\n",
      "    PDF_ANNOT_IS_NO_ZOOM = 8\n",
      "    PDF_ANNOT_IS_PRINT = 4\n",
      "    PDF_ANNOT_IS_READ_ONLY = 64\n",
      "    PDF_ANNOT_IS_TOGGLE_NO_VIEW = 256\n",
      "    PDF_ANNOT_LE_BUTT = 6\n",
      "    PDF_ANNOT_LE_CIRCLE = 2\n",
      "    PDF_ANNOT_LE_CLOSED_ARROW = 5\n",
      "    PDF_ANNOT_LE_DIAMOND = 3\n",
      "    PDF_ANNOT_LE_NONE = 0\n",
      "    PDF_ANNOT_LE_OPEN_ARROW = 4\n",
      "    PDF_ANNOT_LE_R_CLOSED_ARROW = 8\n",
      "    PDF_ANNOT_LE_R_OPEN_ARROW = 7\n",
      "    PDF_ANNOT_LE_SLASH = 9\n",
      "    PDF_ANNOT_LE_SQUARE = 1\n",
      "    PDF_ANNOT_LINE = 3\n",
      "    PDF_ANNOT_LINK = 1\n",
      "    PDF_ANNOT_MOVIE = 19\n",
      "    PDF_ANNOT_POLYGON = 6\n",
      "    PDF_ANNOT_POLY_LINE = 7\n",
      "    PDF_ANNOT_POPUP = 16\n",
      "    PDF_ANNOT_PRINTER_MARK = 23\n",
      "    PDF_ANNOT_PROJECTION = 27\n",
      "    PDF_ANNOT_Q_CENTER = 1\n",
      "    PDF_ANNOT_Q_LEFT = 0\n",
      "    PDF_ANNOT_Q_RIGHT = 2\n",
      "    PDF_ANNOT_REDACT = 12\n",
      "    PDF_ANNOT_RICH_MEDIA = 20\n",
      "    PDF_ANNOT_SCREEN = 22\n",
      "    PDF_ANNOT_SOUND = 18\n",
      "    PDF_ANNOT_SQUARE = 4\n",
      "    PDF_ANNOT_SQUIGGLY = 10\n",
      "    PDF_ANNOT_STAMP = 13\n",
      "    PDF_ANNOT_STRIKE_OUT = 11\n",
      "    PDF_ANNOT_TEXT = 0\n",
      "    PDF_ANNOT_TRAP_NET = 24\n",
      "    PDF_ANNOT_UNDERLINE = 9\n",
      "    PDF_ANNOT_UNKNOWN = -1\n",
      "    PDF_ANNOT_WATERMARK = 25\n",
      "    PDF_ANNOT_WIDGET = 21\n",
      "    PDF_BM_Color = 'Color'\n",
      "    PDF_BM_ColorBurn = 'ColorBurn'\n",
      "    PDF_BM_ColorDodge = 'ColorDodge'\n",
      "    PDF_BM_Darken = 'Darken'\n",
      "    PDF_BM_Difference = 'Difference'\n",
      "    PDF_BM_Exclusion = 'Exclusion'\n",
      "    PDF_BM_HardLight = 'HardLight'\n",
      "    PDF_BM_Hue = 'Hue'\n",
      "    PDF_BM_Lighten = 'Lighten'\n",
      "    PDF_BM_Luminosity = 'Luminosity'\n",
      "    PDF_BM_Multiply = 'Multiply'\n",
      "    PDF_BM_Normal = 'Normal'\n",
      "    PDF_BM_Overlay = 'Overlay'\n",
      "    PDF_BM_Saturation = 'Saturation'\n",
      "    PDF_BM_Screen = 'Screen'\n",
      "    PDF_BM_SoftLight = 'Softlight'\n",
      "    PDF_BORDER_EFFECT_CLOUDY = 1\n",
      "    PDF_BORDER_EFFECT_NONE = 0\n",
      "    PDF_BORDER_STYLE_BEVELED = 2\n",
      "    PDF_BORDER_STYLE_DASHED = 1\n",
      "    PDF_BORDER_STYLE_INSET = 3\n",
      "    PDF_BORDER_STYLE_SOLID = 0\n",
      "    PDF_BORDER_STYLE_UNDERLINE = 4\n",
      "    PDF_BTN_FIELD_IS_NO_TOGGLE_TO_OFF = 16384\n",
      "    PDF_BTN_FIELD_IS_PUSHBUTTON = 65536\n",
      "    PDF_BTN_FIELD_IS_RADIO = 32768\n",
      "    PDF_BTN_FIELD_IS_RADIOS_IN_UNISON = 33554432\n",
      "    PDF_CH_FIELD_IS_COMBO = 131072\n",
      "    PDF_CH_FIELD_IS_COMMIT_ON_SEL_CHANGE = 33554432\n",
      "    PDF_CH_FIELD_IS_DO_NOT_SPELL_CHECK = 4194304\n",
      "    PDF_CH_FIELD_IS_EDIT = 262144\n",
      "    PDF_CH_FIELD_IS_MULTI_SELECT = 2097152\n",
      "    PDF_CH_FIELD_IS_SORT = 524288\n",
      "    PDF_CID_FONT_RESOURCE = 2\n",
      "    PDF_CJK_FONT_RESOURCE = 3\n",
      "    PDF_DOCUMENT_EVENT_ALERT = 0\n",
      "    PDF_DOCUMENT_EVENT_EXEC_MENU_ITEM = 5\n",
      "    PDF_DOCUMENT_EVENT_LAUNCH_URL = 2\n",
      "    PDF_DOCUMENT_EVENT_MAIL_DOC = 3\n",
      "    PDF_DOCUMENT_EVENT_PRINT = 1\n",
      "    PDF_DOCUMENT_EVENT_SUBMIT = 4\n",
      "    PDF_ENCRYPT_AES_128 = 4\n",
      "    PDF_ENCRYPT_AES_256 = 5\n",
      "    PDF_ENCRYPT_KEEP = 0\n",
      "    PDF_ENCRYPT_NONE = 1\n",
      "    PDF_ENCRYPT_RC4_128 = 3\n",
      "    PDF_ENCRYPT_RC4_40 = 2\n",
      "    PDF_ENCRYPT_UNKNOWN = 6\n",
      "    PDF_ENUM_FALSE = 2\n",
      "    PDF_ENUM_LIMIT = 566\n",
      "    PDF_ENUM_NULL = 0\n",
      "    PDF_ENUM_TRUE = 1\n",
      "    PDF_FD_ALL_CAP = 65536\n",
      "    PDF_FD_FIXED_PITCH = 1\n",
      "    PDF_FD_FORCE_BOLD = 262144\n",
      "    PDF_FD_ITALIC = 64\n",
      "    PDF_FD_NONSYMBOLIC = 32\n",
      "    PDF_FD_SCRIPT = 8\n",
      "    PDF_FD_SERIF = 2\n",
      "    PDF_FD_SMALL_CAP = 131072\n",
      "    PDF_FD_SYMBOLIC = 4\n",
      "    PDF_FIELD_IS_NO_EXPORT = 4\n",
      "    PDF_FIELD_IS_READ_ONLY = 1\n",
      "    PDF_FIELD_IS_REQUIRED = 2\n",
      "    PDF_LAYER_UI_CHECKBOX = 1\n",
      "    PDF_LAYER_UI_LABEL = 0\n",
      "    PDF_LAYER_UI_RADIOBOX = 2\n",
      "    PDF_LEXBUF_LARGE = 65536\n",
      "    PDF_LEXBUF_SMALL = 256\n",
      "    PDF_MAX_GEN_NUMBER = 65535\n",
      "    PDF_MAX_OBJECT_NUMBER = 8388607\n",
      "    PDF_MRANGE_CAP = 32\n",
      "    PDF_NUM_TOKENS = 25\n",
      "    PDF_OC_OFF = 2\n",
      "    PDF_OC_ON = 0\n",
      "    PDF_OC_TOGGLE = 1\n",
      "    PDF_PAGE_LABEL_ALPHA_LC = 'a'\n",
      "    PDF_PAGE_LABEL_ALPHA_UC = 'A'\n",
      "    PDF_PAGE_LABEL_DECIMAL = 'D'\n",
      "    PDF_PAGE_LABEL_NONE = 0\n",
      "    PDF_PAGE_LABEL_ROMAN_LC = 'r'\n",
      "    PDF_PAGE_LABEL_ROMAN_UC = 'R'\n",
      "    PDF_PERM_ACCESSIBILITY = 512\n",
      "    PDF_PERM_ANNOTATE = 32\n",
      "    PDF_PERM_ASSEMBLE = 1024\n",
      "    PDF_PERM_COPY = 16\n",
      "    PDF_PERM_FORM = 256\n",
      "    PDF_PERM_MODIFY = 8\n",
      "    PDF_PERM_PRINT = 4\n",
      "    PDF_PERM_PRINT_HQ = 2048\n",
      "    PDF_PROCESSOR_REQUIRES_DECODED_IMAGES = 1\n",
      "    PDF_REDACT_IMAGE_NONE = 0\n",
      "    PDF_REDACT_IMAGE_PIXELS = 2\n",
      "    PDF_REDACT_IMAGE_REMOVE = 1\n",
      "    PDF_REDACT_IMAGE_REMOVE_UNLESS_INVISIBLE = 3\n",
      "    PDF_REDACT_LINE_ART_NONE = 0\n",
      "    PDF_REDACT_LINE_ART_REMOVE_IF_COVERED = 1\n",
      "    PDF_REDACT_LINE_ART_REMOVE_IF_TOUCHED = 2\n",
      "    PDF_SIGNATURE_DEFAULT_APPEARANCE = 63\n",
      "    PDF_SIGNATURE_ERROR_DIGEST_FAILURE = 3\n",
      "    PDF_SIGNATURE_ERROR_NOT_TRUSTED = 6\n",
      "    PDF_SIGNATURE_ERROR_NO_CERTIFICATE = 2\n",
      "    PDF_SIGNATURE_ERROR_NO_SIGNATURES = 1\n",
      "    PDF_SIGNATURE_ERROR_OKAY = 0\n",
      "    PDF_SIGNATURE_ERROR_SELF_SIGNED = 4\n",
      "    PDF_SIGNATURE_ERROR_SELF_SIGNED_IN_CHAIN = 5\n",
      "    PDF_SIGNATURE_ERROR_UNKNOWN = 7\n",
      "    PDF_SIGNATURE_SHOW_DATE = 4\n",
      "    PDF_SIGNATURE_SHOW_DN = 2\n",
      "    PDF_SIGNATURE_SHOW_GRAPHIC_NAME = 16\n",
      "    PDF_SIGNATURE_SHOW_LABELS = 1\n",
      "    PDF_SIGNATURE_SHOW_LOGO = 32\n",
      "    PDF_SIGNATURE_SHOW_TEXT_NAME = 8\n",
      "    PDF_SIMPLE_ENCODING_CYRILLIC = 2\n",
      "    PDF_SIMPLE_ENCODING_GREEK = 1\n",
      "    PDF_SIMPLE_ENCODING_LATIN = 0\n",
      "    PDF_SIMPLE_FONT_RESOURCE = 1\n",
      "    PDF_TOK_CLOSE_ARRAY = 3\n",
      "    PDF_TOK_CLOSE_BRACE = 7\n",
      "    PDF_TOK_CLOSE_DICT = 5\n",
      "    PDF_TOK_ENDOBJ = 18\n",
      "    PDF_TOK_ENDSTREAM = 20\n",
      "    PDF_TOK_EOF = 1\n",
      "    PDF_TOK_ERROR = 0\n",
      "    PDF_TOK_FALSE = 15\n",
      "    PDF_TOK_INT = 9\n",
      "    PDF_TOK_KEYWORD = 12\n",
      "    PDF_TOK_NAME = 8\n",
      "    PDF_TOK_NEWOBJ = 24\n",
      "    PDF_TOK_NULL = 16\n",
      "    PDF_TOK_OBJ = 17\n",
      "    PDF_TOK_OPEN_ARRAY = 2\n",
      "    PDF_TOK_OPEN_BRACE = 6\n",
      "    PDF_TOK_OPEN_DICT = 4\n",
      "    PDF_TOK_R = 13\n",
      "    PDF_TOK_REAL = 10\n",
      "    PDF_TOK_STARTXREF = 23\n",
      "    PDF_TOK_STREAM = 19\n",
      "    PDF_TOK_STRING = 11\n",
      "    PDF_TOK_TRAILER = 22\n",
      "    PDF_TOK_TRUE = 14\n",
      "    PDF_TOK_XREF = 21\n",
      "    PDF_TX_FIELD_IS_COMB = 16777216\n",
      "    PDF_TX_FIELD_IS_DO_NOT_SCROLL = 8388608\n",
      "    PDF_TX_FIELD_IS_DO_NOT_SPELL_CHECK = 4194304\n",
      "    PDF_TX_FIELD_IS_FILE_SELECT = 1048576\n",
      "    PDF_TX_FIELD_IS_MULTILINE = 4096\n",
      "    PDF_TX_FIELD_IS_PASSWORD = 8192\n",
      "    PDF_TX_FIELD_IS_RICH_TEXT = 33554432\n",
      "    PDF_WIDGET_TX_FORMAT_DATE = 3\n",
      "    PDF_WIDGET_TX_FORMAT_NONE = 0\n",
      "    PDF_WIDGET_TX_FORMAT_NUMBER = 1\n",
      "    PDF_WIDGET_TX_FORMAT_SPECIAL = 2\n",
      "    PDF_WIDGET_TX_FORMAT_TIME = 4\n",
      "    PDF_WIDGET_TYPE_BUTTON = 1\n",
      "    PDF_WIDGET_TYPE_CHECKBOX = 2\n",
      "    PDF_WIDGET_TYPE_COMBOBOX = 3\n",
      "    PDF_WIDGET_TYPE_LISTBOX = 4\n",
      "    PDF_WIDGET_TYPE_RADIOBUTTON = 5\n",
      "    PDF_WIDGET_TYPE_SIGNATURE = 6\n",
      "    PDF_WIDGET_TYPE_TEXT = 7\n",
      "    PDF_WIDGET_TYPE_UNKNOWN = 0\n",
      "    PyExc_ValueError = 'ValueError'\n",
      "    STAMP_Approved = 0\n",
      "    STAMP_AsIs = 1\n",
      "    STAMP_Confidential = 2\n",
      "    STAMP_Departmental = 3\n",
      "    STAMP_Draft = 13\n",
      "    STAMP_Experimental = 4\n",
      "    STAMP_Expired = 5\n",
      "    STAMP_Final = 6\n",
      "    STAMP_ForComment = 7\n",
      "    STAMP_ForPublicRelease = 8\n",
      "    STAMP_NotApproved = 9\n",
      "    STAMP_NotForPublicRelease = 10\n",
      "    STAMP_Sold = 11\n",
      "    STAMP_TopSecret = 12\n",
      "    SigFlag_AppendOnly = 2\n",
      "    SigFlag_SignaturesExist = 1\n",
      "    TESSDATA_PREFIX = None\n",
      "    TEXTFLAGS_BLOCKS = 195\n",
      "    TEXTFLAGS_DICT = 199\n",
      "    TEXTFLAGS_HTML = 199\n",
      "    TEXTFLAGS_RAWDICT = 199\n",
      "    TEXTFLAGS_SEARCH = 211\n",
      "    TEXTFLAGS_TEXT = 195\n",
      "    TEXTFLAGS_WORDS = 195\n",
      "    TEXTFLAGS_XHTML = 199\n",
      "    TEXTFLAGS_XML = 195\n",
      "    TEXT_ALIGN_CENTER = 1\n",
      "    TEXT_ALIGN_JUSTIFY = 3\n",
      "    TEXT_ALIGN_LEFT = 0\n",
      "    TEXT_ALIGN_RIGHT = 2\n",
      "    TEXT_CID_FOR_UNKNOWN_UNICODE = 128\n",
      "    TEXT_DEHYPHENATE = 16\n",
      "    TEXT_ENCODING_CYRILLIC = 2\n",
      "    TEXT_ENCODING_GREEK = 1\n",
      "    TEXT_ENCODING_LATIN = 0\n",
      "    TEXT_FONT_BOLD = 16\n",
      "    TEXT_FONT_ITALIC = 2\n",
      "    TEXT_FONT_MONOSPACED = 8\n",
      "    TEXT_FONT_SERIFED = 4\n",
      "    TEXT_FONT_SUPERSCRIPT = 1\n",
      "    TEXT_INHIBIT_SPACES = 8\n",
      "    TEXT_MEDIABOX_CLIP = 64\n",
      "    TEXT_OUTPUT_HTML = 1\n",
      "    TEXT_OUTPUT_JSON = 2\n",
      "    TEXT_OUTPUT_TEXT = 0\n",
      "    TEXT_OUTPUT_XHTML = 4\n",
      "    TEXT_OUTPUT_XML = 3\n",
      "    TEXT_PRESERVE_IMAGES = 4\n",
      "    TEXT_PRESERVE_LIGATURES = 1\n",
      "    TEXT_PRESERVE_SPANS = 32\n",
      "    TEXT_PRESERVE_WHITESPACE = 2\n",
      "    TOOLS_JM_UNIQUE_ID = 1\n",
      "    UCDN_SCRIPT_ADLAM = 132\n",
      "    UCDN_SCRIPT_AHOM = 126\n",
      "    UCDN_SCRIPT_ANATOLIAN_HIEROGLYPHS = 127\n",
      "    UCDN_SCRIPT_ARABIC = 6\n",
      "    UCDN_SCRIPT_ARMENIAN = 4\n",
      "    UCDN_SCRIPT_AVESTAN = 79\n",
      "    UCDN_SCRIPT_BALINESE = 61\n",
      "    UCDN_SCRIPT_BAMUM = 83\n",
      "    UCDN_SCRIPT_BASSA_VAH = 103\n",
      "    UCDN_SCRIPT_BATAK = 92\n",
      "    UCDN_SCRIPT_BENGALI = 10\n",
      "    UCDN_SCRIPT_BHAIKSUKI = 133\n",
      "    UCDN_SCRIPT_BOPOMOFO = 34\n",
      "    UCDN_SCRIPT_BRAHMI = 93\n",
      "    UCDN_SCRIPT_BRAILLE = 52\n",
      "    UCDN_SCRIPT_BUGINESE = 53\n",
      "    UCDN_SCRIPT_BUHID = 43\n",
      "    UCDN_SCRIPT_CANADIAN_ABORIGINAL = 27\n",
      "    UCDN_SCRIPT_CARIAN = 74\n",
      "    UCDN_SCRIPT_CAUCASIAN_ALBANIAN = 104\n",
      "    UCDN_SCRIPT_CHAKMA = 95\n",
      "    UCDN_SCRIPT_CHAM = 76\n",
      "    UCDN_SCRIPT_CHEROKEE = 26\n",
      "    UCDN_SCRIPT_CHORASMIAN = 153\n",
      "    UCDN_SCRIPT_COMMON = 0\n",
      "    UCDN_SCRIPT_COPTIC = 54\n",
      "    UCDN_SCRIPT_CUNEIFORM = 62\n",
      "    UCDN_SCRIPT_CYPRIOT = 51\n",
      "    UCDN_SCRIPT_CYPRO_MINOAN = 159\n",
      "    UCDN_SCRIPT_CYRILLIC = 3\n",
      "    UCDN_SCRIPT_DESERET = 39\n",
      "    UCDN_SCRIPT_DEVANAGARI = 9\n",
      "    UCDN_SCRIPT_DIVES_AKURU = 154\n",
      "    UCDN_SCRIPT_DOGRA = 142\n",
      "    UCDN_SCRIPT_DUPLOYAN = 105\n",
      "    UCDN_SCRIPT_EGYPTIAN_HIEROGLYPHS = 80\n",
      "    UCDN_SCRIPT_ELBASAN = 106\n",
      "    UCDN_SCRIPT_ELYMAIC = 149\n",
      "    UCDN_SCRIPT_ETHIOPIC = 25\n",
      "    UCDN_SCRIPT_GEORGIAN = 23\n",
      "    UCDN_SCRIPT_GLAGOLITIC = 56\n",
      "    UCDN_SCRIPT_GOTHIC = 38\n",
      "    UCDN_SCRIPT_GRANTHA = 107\n",
      "    UCDN_SCRIPT_GREEK = 2\n",
      "    UCDN_SCRIPT_GUJARATI = 12\n",
      "    UCDN_SCRIPT_GUNJALA_GONDI = 143\n",
      "    UCDN_SCRIPT_GURMUKHI = 11\n",
      "    UCDN_SCRIPT_HAN = 35\n",
      "    UCDN_SCRIPT_HANGUL = 24\n",
      "    UCDN_SCRIPT_HANIFI_ROHINGYA = 144\n",
      "    UCDN_SCRIPT_HANUNOO = 42\n",
      "    UCDN_SCRIPT_HATRAN = 128\n",
      "    UCDN_SCRIPT_HEBREW = 5\n",
      "    UCDN_SCRIPT_HIRAGANA = 32\n",
      "    UCDN_SCRIPT_IMPERIAL_ARAMAIC = 86\n",
      "    UCDN_SCRIPT_INHERITED = 40\n",
      "    UCDN_SCRIPT_INSCRIPTIONAL_PAHLAVI = 89\n",
      "    UCDN_SCRIPT_INSCRIPTIONAL_PARTHIAN = 88\n",
      "    UCDN_SCRIPT_JAVANESE = 84\n",
      "    UCDN_SCRIPT_KAITHI = 91\n",
      "    UCDN_SCRIPT_KANNADA = 16\n",
      "    UCDN_SCRIPT_KATAKANA = 33\n",
      "    UCDN_SCRIPT_KAWI = 162\n",
      "    UCDN_SCRIPT_KAYAH_LI = 71\n",
      "    UCDN_SCRIPT_KHAROSHTHI = 60\n",
      "    UCDN_SCRIPT_KHITAN_SMALL_SCRIPT = 155\n",
      "    UCDN_SCRIPT_KHMER = 30\n",
      "    UCDN_SCRIPT_KHOJKI = 108\n",
      "    UCDN_SCRIPT_KHUDAWADI = 109\n",
      "    UCDN_SCRIPT_LAO = 20\n",
      "    UCDN_SCRIPT_LATIN = 1\n",
      "    UCDN_SCRIPT_LEPCHA = 67\n",
      "    UCDN_SCRIPT_LIMBU = 45\n",
      "    UCDN_SCRIPT_LINEAR_A = 110\n",
      "    UCDN_SCRIPT_LINEAR_B = 47\n",
      "    UCDN_SCRIPT_LISU = 82\n",
      "    UCDN_SCRIPT_LYCIAN = 73\n",
      "    UCDN_SCRIPT_LYDIAN = 75\n",
      "    UCDN_SCRIPT_MAHAJANI = 111\n",
      "    UCDN_SCRIPT_MAKASAR = 145\n",
      "    UCDN_SCRIPT_MALAYALAM = 17\n",
      "    UCDN_SCRIPT_MANDAIC = 94\n",
      "    UCDN_SCRIPT_MANICHAEAN = 112\n",
      "    UCDN_SCRIPT_MARCHEN = 134\n",
      "    UCDN_SCRIPT_MASARAM_GONDI = 138\n",
      "    UCDN_SCRIPT_MEDEFAIDRIN = 146\n",
      "    UCDN_SCRIPT_MEETEI_MAYEK = 85\n",
      "    UCDN_SCRIPT_MENDE_KIKAKUI = 113\n",
      "    UCDN_SCRIPT_MEROITIC_CURSIVE = 96\n",
      "    UCDN_SCRIPT_MEROITIC_HIEROGLYPHS = 97\n",
      "    UCDN_SCRIPT_MIAO = 98\n",
      "    UCDN_SCRIPT_MODI = 114\n",
      "    UCDN_SCRIPT_MONGOLIAN = 31\n",
      "    UCDN_SCRIPT_MRO = 115\n",
      "    UCDN_SCRIPT_MULTANI = 129\n",
      "    UCDN_SCRIPT_MYANMAR = 22\n",
      "    UCDN_SCRIPT_NABATAEAN = 116\n",
      "    UCDN_SCRIPT_NAG_MUNDARI = 163\n",
      "    UCDN_SCRIPT_NANDINAGARI = 150\n",
      "    UCDN_SCRIPT_NEWA = 135\n",
      "    UCDN_SCRIPT_NEW_TAI_LUE = 55\n",
      "    UCDN_SCRIPT_NKO = 65\n",
      "    UCDN_SCRIPT_NUSHU = 139\n",
      "    UCDN_SCRIPT_NYIAKENG_PUACHUE_HMONG = 151\n",
      "    UCDN_SCRIPT_OGHAM = 28\n",
      "    UCDN_SCRIPT_OLD_HUNGARIAN = 130\n",
      "    UCDN_SCRIPT_OLD_ITALIC = 37\n",
      "    UCDN_SCRIPT_OLD_NORTH_ARABIAN = 117\n",
      "    UCDN_SCRIPT_OLD_PERMIC = 118\n",
      "    UCDN_SCRIPT_OLD_PERSIAN = 59\n",
      "    UCDN_SCRIPT_OLD_SOGDIAN = 147\n",
      "    UCDN_SCRIPT_OLD_SOUTH_ARABIAN = 87\n",
      "    UCDN_SCRIPT_OLD_TURKIC = 90\n",
      "    UCDN_SCRIPT_OLD_UYGHUR = 158\n",
      "    UCDN_SCRIPT_OL_CHIKI = 68\n",
      "    UCDN_SCRIPT_ORIYA = 13\n",
      "    UCDN_SCRIPT_OSAGE = 136\n",
      "    UCDN_SCRIPT_OSMANYA = 50\n",
      "    UCDN_SCRIPT_PAHAWH_HMONG = 119\n",
      "    UCDN_SCRIPT_PALMYRENE = 120\n",
      "    UCDN_SCRIPT_PAU_CIN_HAU = 121\n",
      "    UCDN_SCRIPT_PHAGS_PA = 64\n",
      "    UCDN_SCRIPT_PHOENICIAN = 63\n",
      "    UCDN_SCRIPT_PSALTER_PAHLAVI = 122\n",
      "    UCDN_SCRIPT_REJANG = 72\n",
      "    UCDN_SCRIPT_RUNIC = 29\n",
      "    UCDN_SCRIPT_SAMARITAN = 81\n",
      "    UCDN_SCRIPT_SAURASHTRA = 70\n",
      "    UCDN_SCRIPT_SHARADA = 99\n",
      "    UCDN_SCRIPT_SHAVIAN = 49\n",
      "    UCDN_SCRIPT_SIDDHAM = 123\n",
      "    UCDN_SCRIPT_SIGNWRITING = 131\n",
      "    UCDN_SCRIPT_SINHALA = 18\n",
      "    UCDN_SCRIPT_SOGDIAN = 148\n",
      "    UCDN_SCRIPT_SORA_SOMPENG = 100\n",
      "    UCDN_SCRIPT_SOYOMBO = 140\n",
      "    UCDN_SCRIPT_SUNDANESE = 66\n",
      "    UCDN_SCRIPT_SYLOTI_NAGRI = 58\n",
      "    UCDN_SCRIPT_SYRIAC = 7\n",
      "    UCDN_SCRIPT_TAGALOG = 41\n",
      "    UCDN_SCRIPT_TAGBANWA = 44\n",
      "    UCDN_SCRIPT_TAI_LE = 46\n",
      "    UCDN_SCRIPT_TAI_THAM = 77\n",
      "    UCDN_SCRIPT_TAI_VIET = 78\n",
      "    UCDN_SCRIPT_TAKRI = 101\n",
      "    UCDN_SCRIPT_TAMIL = 14\n",
      "    UCDN_SCRIPT_TANGSA = 160\n",
      "    UCDN_SCRIPT_TANGUT = 137\n",
      "    UCDN_SCRIPT_TELUGU = 15\n",
      "    UCDN_SCRIPT_THAANA = 8\n",
      "    UCDN_SCRIPT_THAI = 19\n",
      "    UCDN_SCRIPT_TIBETAN = 21\n",
      "    UCDN_SCRIPT_TIFINAGH = 57\n",
      "    UCDN_SCRIPT_TIRHUTA = 124\n",
      "    UCDN_SCRIPT_TOTO = 161\n",
      "    UCDN_SCRIPT_UGARITIC = 48\n",
      "    UCDN_SCRIPT_UNKNOWN = 102\n",
      "    UCDN_SCRIPT_VAI = 69\n",
      "    UCDN_SCRIPT_VITHKUQI = 157\n",
      "    UCDN_SCRIPT_WANCHO = 152\n",
      "    UCDN_SCRIPT_WARANG_CITI = 125\n",
      "    UCDN_SCRIPT_YEZIDI = 156\n",
      "    UCDN_SCRIPT_YI = 36\n",
      "    UCDN_SCRIPT_ZANABAZAR_SQUARE = 141\n",
      "    VersionBind = '1.24.1'\n",
      "    VersionDate = '2024-04-02 00:00:01'\n",
      "    VersionDate2 = '20240402000001'\n",
      "    VersionFitz = '1.24.1'\n",
      "    annot_skel = {'goto1': '<</A<</S/GoTo/D[%i 0 R/XYZ %g %g %g]>>/Rect[%s...\n",
      "    csCMYK = Colorspace(CS_CMYK) - DeviceCMYK\n",
      "    csGRAY = Colorspace(CS_GRAY) - DeviceGray\n",
      "    csRGB = Colorspace(CS_RGB) - DeviceRGB\n",
      "    dictkey_align = 'ascender'\n",
      "    dictkey_bbox = 'bbox'\n",
      "    dictkey_blocks = 'blocks'\n",
      "    dictkey_bpc = 'bpc'\n",
      "    dictkey_c = 'c'\n",
      "    dictkey_chars = 'chars'\n",
      "    dictkey_color = 'color'\n",
      "    dictkey_colorspace = 'colorspace'\n",
      "    dictkey_content = 'content'\n",
      "    dictkey_creationDate = 'creationDate'\n",
      "    dictkey_cs_name = 'cs-name'\n",
      "    dictkey_da = 'da'\n",
      "    dictkey_dashes = 'dashes'\n",
      "    dictkey_desc = 'descender'\n",
      "    dictkey_dir = 'dir'\n",
      "    dictkey_effect = 'effect'\n",
      "    dictkey_ext = 'ext'\n",
      "    dictkey_filename = 'filename'\n",
      "    dictkey_fill = 'fill'\n",
      "    dictkey_flags = 'flags'\n",
      "    dictkey_font = 'font'\n",
      "    dictkey_glyph = 'glyph'\n",
      "    dictkey_height = 'height'\n",
      "    dictkey_id = 'id'\n",
      "    dictkey_image = 'image'\n",
      "    dictkey_items = 'items'\n",
      "    dictkey_length = 'length'\n",
      "    dictkey_lines = 'lines'\n",
      "    dictkey_matrix = 'transform'\n",
      "    dictkey_modDate = 'modDate'\n",
      "    dictkey_name = 'name'\n",
      "    dictkey_number = 'number'\n",
      "    dictkey_origin = 'origin'\n",
      "    dictkey_rect = 'rect'\n",
      "    dictkey_size = 'size'\n",
      "    dictkey_smask = 'smask'\n",
      "    dictkey_spans = 'spans'\n",
      "    dictkey_stroke = 'stroke'\n",
      "    dictkey_style = 'style'\n",
      "    dictkey_subject = 'subject'\n",
      "    dictkey_text = 'text'\n",
      "    dictkey_title = 'title'\n",
      "    dictkey_type = 'type'\n",
      "    dictkey_ufilename = 'ufilename'\n",
      "    dictkey_width = 'width'\n",
      "    dictkey_wmode = 'wmode'\n",
      "    dictkey_xref = 'xref'\n",
      "    dictkey_xres = 'xres'\n",
      "    dictkey_yres = 'yres'\n",
      "    f = 'ZapfDingbats'\n",
      "    fitz_fontdescriptors = {}\n",
      "    g_exceptions_verbose = 1\n",
      "    g_img_info = None\n",
      "    g_no_device_caching = 0\n",
      "    g_skip_quad_corrections = 0\n",
      "    g_small_glyph_heights = 0\n",
      "    g_subset_fontnames = 0\n",
      "    g_use_extra = True\n",
      "    matrix_like = 'matrix_like'\n",
      "    mupdf_cppyy = None\n",
      "    mupdf_version_tuple = (1, 24, 1)\n",
      "    pdfcolor = {'aliceblue': (0.9411764705882353, 0.9725490196078431, 1.0)...\n",
      "    point_like = 'point_like'\n",
      "    pymupdf_version_tuple = (1, 24, 1)\n",
      "    quad_like = 'quad_like'\n",
      "    rect_like = 'rect_like'\n",
      "    symbol_glyphs = ((183, 0.46), (183, 0.46), (183, 0.46), (183, 0.46), (...\n",
      "    trace_device_CLIP_PATH = 3\n",
      "    trace_device_CLIP_STROKE_PATH = 4\n",
      "    trace_device_FILL_PATH = 1\n",
      "    trace_device_STROKE_PATH = 2\n",
      "    version = ('1.24.1', '1.24.1', '20240402000001')\n",
      "    zapf_glyphs = ((183, 0.788), (183, 0.788), (183, 0.788), (183, 0.788),...\n",
      "\n",
      "VERSION\n",
      "    1.24.1\n",
      "\n",
      "FILE\n",
      "    /home/huang/anaconda3/lib/python3.9/site-packages/fitz/__init__.py\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(fitz)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 定义一个函数来将 PDF 页面转换为图片\n",
    "def pdf_to_images(page,image_filename,output_folder):    \n",
    "    \n",
    "    # 指定输出路径\n",
    "    image_output_path = f\"{output_folder}/{image_filename}\"\n",
    "    \n",
    "    # 将页面保存为图片\n",
    "    page.get_pixmap(dpi=360).save(image_output_path)\n",
    "    \n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "# PDF 文件路径\n",
    "pdf_path = work_path+\"/工银亚洲营业部.pdf\"\n",
    "# 输出图片的文件夹路径\n",
    "output_folder = work_path\n",
    "# 调用函数进行转换\n",
    "pdf_to_images(doc[0],\"1.png\", output_folder)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['__class__',\n",
       " '__delattr__',\n",
       " '__dict__',\n",
       " '__dir__',\n",
       " '__doc__',\n",
       " '__eq__',\n",
       " '__format__',\n",
       " '__ge__',\n",
       " '__getattribute__',\n",
       " '__gt__',\n",
       " '__hash__',\n",
       " '__init__',\n",
       " '__init_subclass__',\n",
       " '__le__',\n",
       " '__lt__',\n",
       " '__module__',\n",
       " '__ne__',\n",
       " '__new__',\n",
       " '__reduce__',\n",
       " '__reduce_ex__',\n",
       " '__repr__',\n",
       " '__setattr__',\n",
       " '__sizeof__',\n",
       " '__str__',\n",
       " '__subclasshook__',\n",
       " '__weakref__',\n",
       " '_addAnnot_FromString',\n",
       " '_addWidget',\n",
       " '_add_caret_annot',\n",
       " '_add_file_annot',\n",
       " '_add_freetext_annot',\n",
       " '_add_ink_annot',\n",
       " '_add_line_annot',\n",
       " '_add_multiline',\n",
       " '_add_redact_annot',\n",
       " '_add_square_or_circle',\n",
       " '_add_stamp_annot',\n",
       " '_add_text_annot',\n",
       " '_add_text_marker',\n",
       " '_annot_refs',\n",
       " '_apply_redactions',\n",
       " '_erase',\n",
       " '_get_optional_content',\n",
       " '_get_resource_properties',\n",
       " '_get_textpage',\n",
       " '_insertFont',\n",
       " '_insert_image',\n",
       " '_load_annot',\n",
       " '_makePixmap',\n",
       " '_other_box',\n",
       " '_pdf_page',\n",
       " '_reset_annot_refs',\n",
       " '_set_opacity',\n",
       " '_set_pagebox',\n",
       " '_set_resource_property',\n",
       " '_show_pdf_page',\n",
       " '_unused_annot_xrefs',\n",
       " 'add_caret_annot',\n",
       " 'add_circle_annot',\n",
       " 'add_file_annot',\n",
       " 'add_freetext_annot',\n",
       " 'add_highlight_annot',\n",
       " 'add_ink_annot',\n",
       " 'add_line_annot',\n",
       " 'add_polygon_annot',\n",
       " 'add_polyline_annot',\n",
       " 'add_rect_annot',\n",
       " 'add_redact_annot',\n",
       " 'add_squiggly_annot',\n",
       " 'add_stamp_annot',\n",
       " 'add_strikeout_annot',\n",
       " 'add_text_annot',\n",
       " 'add_underline_annot',\n",
       " 'add_widget',\n",
       " 'annot_names',\n",
       " 'annot_xrefs',\n",
       " 'annots',\n",
       " 'apply_redactions',\n",
       " 'artbox',\n",
       " 'bleedbox',\n",
       " 'bound',\n",
       " 'clean_contents',\n",
       " 'cropbox',\n",
       " 'cropbox_position',\n",
       " 'delete_annot',\n",
       " 'delete_image',\n",
       " 'delete_link',\n",
       " 'delete_widget',\n",
       " 'derotation_matrix',\n",
       " 'draw_bezier',\n",
       " 'draw_circle',\n",
       " 'draw_cont',\n",
       " 'draw_curve',\n",
       " 'draw_line',\n",
       " 'draw_oval',\n",
       " 'draw_polyline',\n",
       " 'draw_quad',\n",
       " 'draw_rect',\n",
       " 'draw_sector',\n",
       " 'draw_squiggle',\n",
       " 'draw_zigzag',\n",
       " 'extend_textpage',\n",
       " 'find_tables',\n",
       " 'first_annot',\n",
       " 'first_link',\n",
       " 'first_widget',\n",
       " 'get_bboxlog',\n",
       " 'get_cdrawings',\n",
       " 'get_contents',\n",
       " 'get_displaylist',\n",
       " 'get_drawings',\n",
       " 'get_fonts',\n",
       " 'get_image_bbox',\n",
       " 'get_image_info',\n",
       " 'get_image_rects',\n",
       " 'get_images',\n",
       " 'get_label',\n",
       " 'get_links',\n",
       " 'get_oc_items',\n",
       " 'get_pixmap',\n",
       " 'get_svg_image',\n",
       " 'get_text',\n",
       " 'get_text_blocks',\n",
       " 'get_text_selection',\n",
       " 'get_text_words',\n",
       " 'get_textbox',\n",
       " 'get_textpage',\n",
       " 'get_textpage_ocr',\n",
       " 'get_texttrace',\n",
       " 'get_xobjects',\n",
       " 'insert_font',\n",
       " 'insert_htmlbox',\n",
       " 'insert_image',\n",
       " 'insert_link',\n",
       " 'insert_text',\n",
       " 'insert_textbox',\n",
       " 'is_wrapped',\n",
       " 'language',\n",
       " 'last_point',\n",
       " 'links',\n",
       " 'load_annot',\n",
       " 'load_links',\n",
       " 'load_widget',\n",
       " 'mediabox',\n",
       " 'mediabox_size',\n",
       " 'new_shape',\n",
       " 'number',\n",
       " 'parent',\n",
       " 'read_contents',\n",
       " 'rect',\n",
       " 'refresh',\n",
       " 'replace_image',\n",
       " 'rotation',\n",
       " 'rotation_matrix',\n",
       " 'run',\n",
       " 'search_for',\n",
       " 'set_artbox',\n",
       " 'set_bleedbox',\n",
       " 'set_contents',\n",
       " 'set_cropbox',\n",
       " 'set_language',\n",
       " 'set_mediabox',\n",
       " 'set_rotation',\n",
       " 'set_trimbox',\n",
       " 'show_pdf_page',\n",
       " 'this',\n",
       " 'thisown',\n",
       " 'transformation_matrix',\n",
       " 'trimbox',\n",
       " 'update_link',\n",
       " 'widgets',\n",
       " 'wrap_contents',\n",
       " 'write_text',\n",
       " 'xref']"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dir(doc[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on method get_pixmap in module fitz.utils:\n",
      "\n",
      "get_pixmap(*, matrix: 'matrix_like' = IdentityMatrix(1.0, 0.0, 0.0, 1.0, 0.0, 0.0), dpi=None, colorspace: fitz.Colorspace = Colorspace(CS_RGB) - DeviceRGB, clip: 'rect_like' = None, alpha: bool = False, annots: bool = True) -> fitz.Pixmap method of fitz.Page instance\n",
      "    Create pixmap of page.\n",
      "    \n",
      "    Keyword args:\n",
      "        matrix: Matrix for transformation (default: Identity).\n",
      "        dpi: desired dots per inch. If given, matrix is ignored.\n",
      "        colorspace: (str/Colorspace) cmyk, rgb, gray - case ignored, default csRGB.\n",
      "        clip: (irect-like) restrict rendering to this area.\n",
      "        alpha: (bool) whether to include alpha channel\n",
      "        annots: (bool) whether to also render annotations\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(doc[0].get_pixmap)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [],
   "source": [
    "test_path=work_path+\"/测试文件\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'/home/huang/Documents/machine-readproofing/测试文件'"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_path"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [],
   "source": [
    "doc1=fitz.open(test_path+\"/源文件.pdf\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [],
   "source": [
    "doc2=fitz.open(test_path+\"/转曲文件.pdf\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(doc1)==len(doc2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [],
   "source": [
    "pdf_to_images(doc1[0],\"first.png\",work_path)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [],
   "source": [
    "pdf_to_images(doc2[0],\"second.png\",work_path)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [],
   "source": [
    "from PIL import Image\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "def images_are_identical(image_path1, image_path2):\n",
    "    # 打开两个PNG图像文件\n",
    "    image1 = Image.open(image_path1)\n",
    "    image2 = Image.open(image_path2)\n",
    "    \n",
    "    # 确保两个图像具有相同的尺寸和模式\n",
    "    if image1.size != image2.size or image1.mode != image2.mode:\n",
    "        return False\n",
    "    \n",
    "    # 比较两个图像的像素数据\n",
    "    return image1.tobytes() == image2.tobytes()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [],
   "source": [
    "from PIL import Image\n",
    "\n",
    "def compare_images(image_path1, image_path2):\n",
    "    # 打开两张图片\n",
    "    image1 = Image.open(image_path1).convert('L')  # 转换为灰度图\n",
    "    image2 = Image.open(image_path2).convert('L')  # 转换为灰度图\n",
    "    \n",
    "    # 确保两张图片尺寸相同\n",
    "    if image1.size != image2.size:\n",
    "        raise ValueError(\"Images have different dimensions.\")\n",
    "    \n",
    "    # 计算两张图片的像素差异\n",
    "    difference = sum([abs(a - b) for a, b in zip(image1.getdata(), image2.getdata())])\n",
    "    \n",
    "    # 计算相似度分数，差异越小，相似度越高\n",
    "    similarity_score = 1 - (difference / (255 * image1.size[0] * image1.size[1]))\n",
    "    \n",
    "    return similarity_score\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "# 图像文件路径\n",
    "image_path1 = work_path+'/first.png'\n",
    "image_path2 = work_path+'/second.png'\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The images are identical.\n"
     ]
    }
   ],
   "source": [
    "\n",
    "# 判断两个图像是否显示相同的内容\n",
    "are_identical = images_are_identical(image_path1, image_path2)\n",
    "print(f\"The images are {'identical' if are_identical else 'different'}.\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Similarity score: 1.0\n"
     ]
    }
   ],
   "source": [
    "\n",
    "# 比较两张图片\n",
    "similarity = compare_images(image_path1, image_path2)\n",
    "print(f\"Similarity score: {similarity}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "for i in range(len(doc1)):\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [],
   "source": [
    "def pixmap_to_image(pixmap):\n",
    "    # 将Pixmap对象转换为灰度模式的PIL Image对象\n",
    "    data = pixmap.samples  # 获取像素数据\n",
    "    width, height = pixmap.width, pixmap.height  # 获取图像尺寸\n",
    "    image = Image.frombytes(\"RGB\", (width, height), data)\n",
    "    return image"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [],
   "source": [
    "pixmap_to_image(doc1[0].get_pixmap(dpi=360)).show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.9954145671844411\n",
      "0.9951675476898816\n",
      "0.9965645143883992\n",
      "0.9981306887958632\n",
      "0.9969831282552418\n",
      "0.9975331478624804\n",
      "0.9969738768393211\n",
      "0.9985067923325798\n"
     ]
    }
   ],
   "source": [
    "for i in range(len(doc1)):\n",
    "    image1=pixmap_to_image(doc1[i].get_pixmap(dpi=360)).convert('L')\n",
    "    image2=pixmap_to_image(doc2[i].get_pixmap(dpi=360)).convert('L')\n",
    "    # 确保两张图片尺寸相同\n",
    "    if image1.size != image2.size:\n",
    "        raise ValueError(\"Images have different dimensions.\")\n",
    "    \n",
    "    # 计算两张图片的像素差异\n",
    "    difference = sum([abs(a - b) for a, b in zip(image1.getdata(), image2.getdata())])\n",
    "    \n",
    "    # 计算相似度分数，差异越小，相似度越高\n",
    "    similarity_score = 1 - (difference / (255 * image1.size[0] * image1.size[1]))\n",
    "    \n",
    "    if(similarity_score<0.99):\n",
    "        print(\"the page %d is Difference!\" %i)\n",
    "    else:\n",
    "        print(similarity_score)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'/home/huang/sympy_work_code'"
      ]
     },
     "execution_count": 84,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "os.path.abspath(\"./\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "path.append(\"/home/huang/Documents/machine-readproofing/src/\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "# %load \"../Documents/machine-readproofing/src/check_transfer.py\"\n",
    "from utils import pixmap_to_image, compare_two_image\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1.0\n",
      "OK!\n"
     ]
    }
   ],
   "source": [
    "\n",
    "dir_path = \"/home/huang/Documents/machine-readproofing/测试文件\"\n",
    "file1 = \"国家普通话水平测试准考证1.pdf\"\n",
    "file2 = \"国家普通话水平测试准考证2.pdf\"\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.9998922835990997\n",
      "OK!\n"
     ]
    }
   ],
   "source": [
    "\n",
    "doc1 = fitz.open(dir_path + \"/\" + file1)\n",
    "doc2 = fitz.open(dir_path + \"/\" + file2)\n",
    "if len(doc1) != len(doc2):\n",
    "    EncodingWarning(\"两个文件页面数不一样！\")\n",
    "for i in range(len(doc1)):\n",
    "    image1 = pixmap_to_image(doc1[i].get_pixmap(dpi=160)).convert(\"L\")\n",
    "    image2 = pixmap_to_image(doc2[i].get_pixmap(dpi=160)).convert(\"L\")\n",
    "    # 确保两张图片尺寸相同\n",
    "    similarity_score = compare_two_image(image1, image2)\n",
    "    if similarity_score < 0.99:\n",
    "        print(\"the page %d is Difference!\" % i)\n",
    "        EncodingWarning(\"请检查该不同点。\")\n",
    "    else:\n",
    "        print(similarity_score)\n",
    "print(\"OK!\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "pixmap_to_image(doc1[i].get_pixmap(dpi=160)).convert(\"L\").show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
